Compare commits
4 Commits
2f3f0edc30
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f8022b3f18 | |||
| 57d1ec34c3 | |||
| 81639aaabf | |||
| 5dc1bff60c |
@@ -16,7 +16,7 @@ class GenerateSitemap extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'sitemap:generate';
|
protected $signature = 'app:generate-sitemap';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use Illuminate\Console\Command;
|
|||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Contracts\Encryption\DecryptException;
|
use Illuminate\Contracts\Encryption\DecryptException;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class SyncSubscriptionKeys extends Command
|
class SyncSubscriptionKeys extends Command
|
||||||
{
|
{
|
||||||
@@ -83,7 +84,10 @@ class SyncSubscriptionKeys extends Command
|
|||||||
->whereNotIn('subscription_key', $activeKeys)
|
->whereNotIn('subscription_key', $activeKeys)
|
||||||
->chunk(100, function ($users) {
|
->chunk(100, function ($users) {
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
$user->removeRole(UserRole::SUPPORTER);
|
if ($user->hasRole(UserRole::SUPPORTER)) {
|
||||||
|
Log::info("Removed Supporter Role from {$user->name}");
|
||||||
|
$user->removeRole(UserRole::SUPPORTER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -95,7 +99,10 @@ class SyncSubscriptionKeys extends Command
|
|||||||
->whereIn('subscription_key', $activeKeys)
|
->whereIn('subscription_key', $activeKeys)
|
||||||
->chunk(100, function ($users) {
|
->chunk(100, function ($users) {
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
$user->addRole(UserRole::SUPPORTER);
|
if (!$user->hasRole(UserRole::SUPPORTER)) {
|
||||||
|
Log::info("Added Supporter Role for {$user->name}");
|
||||||
|
$user->addRole(UserRole::SUPPORTER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,21 @@ class DownloadButton extends Component
|
|||||||
|
|
||||||
public $fileExtension = 'HEVC';
|
public $fileExtension = 'HEVC';
|
||||||
|
|
||||||
|
public $version = '';
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if (str_contains($this->downloadUrl, 'AV1')) {
|
if (str_contains($this->downloadUrl, 'AV1')) {
|
||||||
$this->fileExtension = 'AV1';
|
$this->fileExtension = 'AV1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (str_contains($this->downloadUrl, 'v2')) {
|
||||||
|
$this->version = 'v2';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str_contains($this->downloadUrl, 'v3')) {
|
||||||
|
$this->version = 'v3';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clicked($downloadId)
|
public function clicked($downloadId)
|
||||||
|
|||||||
Generated
+9
-9
@@ -3188,6 +3188,15 @@
|
|||||||
"postcss": "^8.0.9"
|
"postcss": "^8.0.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tw-elements/node_modules/yaml": {
|
||||||
|
"version": "1.10.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz",
|
||||||
|
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ua-parser-js": {
|
"node_modules/ua-parser-js": {
|
||||||
"version": "1.0.41",
|
"version": "1.0.41",
|
||||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz",
|
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz",
|
||||||
@@ -3430,15 +3439,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",
|
||||||
"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
|
"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
|
||||||
"node_modules/yaml": {
|
|
||||||
"version": "1.10.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz",
|
|
||||||
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
|
|
||||||
"license": "ISC",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
function updateGrid(grid) {
|
|
||||||
// Skip hidden grids
|
|
||||||
if (grid.offsetParent === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const items = [...grid.querySelectorAll('.episode-item')];
|
|
||||||
|
|
||||||
if (!items.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset visibility first
|
|
||||||
items.forEach(item => {
|
|
||||||
item.style.display = '';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Determine actual column count
|
|
||||||
const firstTop = items[0].offsetTop;
|
|
||||||
|
|
||||||
let columns = 0;
|
|
||||||
|
|
||||||
for (const item of items) {
|
|
||||||
if (item.offsetTop !== firstTop) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
columns++;
|
|
||||||
}
|
|
||||||
|
|
||||||
const rows = parseInt(grid.dataset.rows || '2', 10);
|
|
||||||
|
|
||||||
const visibleItems = columns * rows;
|
|
||||||
|
|
||||||
items.forEach((item, index) => {
|
|
||||||
item.style.display = index < visibleItems
|
|
||||||
? ''
|
|
||||||
: 'none';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateAllEpisodeGrids() {
|
|
||||||
document.querySelectorAll('.episode-grid').forEach(updateGrid);
|
|
||||||
}
|
|
||||||
|
|
||||||
const observer = new IntersectionObserver(entries => {
|
|
||||||
entries.forEach(entry => {
|
|
||||||
if (entry.isIntersecting) {
|
|
||||||
updateGrid(entry.target);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
document.querySelectorAll('.episode-grid').forEach(grid => {
|
|
||||||
observer.observe(grid);
|
|
||||||
});
|
|
||||||
|
|
||||||
let resizeTimeout;
|
|
||||||
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
clearTimeout(resizeTimeout);
|
|
||||||
|
|
||||||
resizeTimeout = setTimeout(() => {
|
|
||||||
updateAllEpisodeGrids();
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('load', updateAllEpisodeGrids);
|
|
||||||
@@ -28,6 +28,4 @@
|
|||||||
<div class="mx-auto pt-6 sm:px-6 lg:px-8 space-y-6 max-w-[100%] xl:max-w-[95%] 2xl:max-w-[85%] pb-2">
|
<div class="mx-auto pt-6 sm:px-6 lg:px-8 space-y-6 max-w-[100%] xl:max-w-[95%] 2xl:max-w-[85%] pb-2">
|
||||||
@include('home.partials.comments')
|
@include('home.partials.comments')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@vite(['resources/js/responsive.js'])
|
|
||||||
</x-app-layout>
|
</x-app-layout>
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
@php
|
@php
|
||||||
$random = \cache()->remember('random_home', 300, function () {
|
$random = \cache()->remember('random_home', 300, function () {
|
||||||
return \App\Models\Episode::inRandomOrder()->limit(7)->get(); ;
|
return \App\Models\Episode::inRandomOrder()->limit(16)->get(); ;
|
||||||
});
|
});
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
@include('home.partials.tab.template', ['episodes' => $random, 'isThumbnail' => false, 'rowsCount' => 1])
|
@include('home.partials.tab.template', ['episodes' => $random, 'isThumbnail' => false])
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,23 +1,34 @@
|
|||||||
@props([
|
@props(['isThumbnail'])
|
||||||
'isThumbnail',
|
|
||||||
'rowsCount' => 2,
|
|
||||||
])
|
|
||||||
|
|
||||||
@php
|
@php
|
||||||
$gridClasses = $isThumbnail
|
|
||||||
? 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4'
|
|
||||||
: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 3xl:grid-cols-7';
|
|
||||||
|
|
||||||
// Render enough items for largest possible layout
|
// Render enough items for largest possible layout
|
||||||
$limit = 24;
|
$limit = 16;
|
||||||
|
|
||||||
$view = $isThumbnail ? 'thumbnail' : 'poster';
|
$view = $isThumbnail ? 'thumbnail' : 'poster';
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
@if ($isThumbnail)
|
||||||
<div
|
<div
|
||||||
class="episode-grid grid {{ $gridClasses }}"
|
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5
|
||||||
data-rows="{{ $rowsCount }}"
|
[&>.episode-item]:hidden
|
||||||
|
[&>.episode-item:nth-child(-n+8)]:block
|
||||||
|
md:[&>.episode-item:nth-child(-n+8)]:block
|
||||||
|
lg:[&>.episode-item:nth-child(-n+9)]:block
|
||||||
|
xl:[&>.episode-item:nth-child(-n+9)]:block
|
||||||
|
2xl:[&>.episode-item:nth-child(-n+12)]:block
|
||||||
|
3xl:[&>.episode-item:nth-child(-n+15)]:block"
|
||||||
>
|
>
|
||||||
|
@else
|
||||||
|
<div
|
||||||
|
class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4 2xl:grid-cols-5 3xl:grid-cols-8
|
||||||
|
[&>.episode-item]:hidden
|
||||||
|
[&>.episode-item:nth-child(-n+12)]:block
|
||||||
|
md:[&>.episode-item:nth-child(-n+12)]:block
|
||||||
|
xl:[&>.episode-item:nth-child(-n+12)]:block
|
||||||
|
2xl:[&>.episode-item:nth-child(-n+15)]:block
|
||||||
|
3xl:[&>.episode-item:nth-child(-n+16)]:block"
|
||||||
|
>
|
||||||
|
@endif
|
||||||
@foreach ($episodes->take($limit) as $ep)
|
@foreach ($episodes->take($limit) as $ep)
|
||||||
@php
|
@php
|
||||||
$episode = isset($popularView)
|
$episode = isset($popularView)
|
||||||
|
|||||||
@@ -8,9 +8,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col text-center w-full">
|
<div class="flex flex-col text-center w-full">
|
||||||
@if($fillNumbers)
|
@if($fillNumbers)
|
||||||
<p class="text-lg">Episode {{ str_pad($episodeNumber, 2, '0', STR_PAD_LEFT) }}</p>
|
@if($version)
|
||||||
|
<p class="text-lg">Episode {{ str_pad($episodeNumber, 2, '0', STR_PAD_LEFT) }} ({{ $version }})</p>
|
||||||
|
@else
|
||||||
|
<p class="text-lg">Episode {{ str_pad($episodeNumber, 2, '0', STR_PAD_LEFT) }}</p>
|
||||||
|
@endif
|
||||||
@else
|
@else
|
||||||
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
@if($version)
|
||||||
|
<p class="text-lg">Episode {{ $episodeNumber }} ({{ $version }})</p>
|
||||||
|
@else
|
||||||
|
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
<p class="text-xs">{{ $fileExtension }} MKV {{ $fileSize ?? '' }}</p>
|
<p class="text-xs">{{ $fileExtension }} MKV {{ $fileSize ?? '' }}</p>
|
||||||
<p class="text-xs" id="count-{{ $downloadId }}">Downloaded {{ $downloadCount }} times</p>
|
<p class="text-xs" id="count-{{ $downloadId }}">Downloaded {{ $downloadCount }} times</p>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
@php
|
@php
|
||||||
$download = $hdl->getDownloadByType('FHDi');
|
$download = $hdl->getDownloadByType('FHDi');
|
||||||
$downloadURL = $dldomains[array_rand($dldomains)].'/'.$download->url;
|
$downloadURL = $dldomains[array_rand($dldomains)].'/'.$download->url;
|
||||||
|
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<livewire:download-button
|
<livewire:download-button
|
||||||
@@ -14,5 +15,6 @@
|
|||||||
:download-count="$download->count"
|
:download-count="$download->count"
|
||||||
:episode-number="$hdl->episode"
|
:episode-number="$hdl->episode"
|
||||||
:fill-numbers="$fillNumbers"
|
:fill-numbers="$fillNumbers"
|
||||||
:file-size="$download->getFileSize()">
|
:file-size="$download->getFileSize()"
|
||||||
|
:version="$version">
|
||||||
@endif
|
@endif
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
$now = \Illuminate\Support\Carbon::now();
|
$now = \Illuminate\Support\Carbon::now();
|
||||||
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
||||||
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
||||||
|
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||||
|
|
||||||
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
||||||
@endphp
|
@endphp
|
||||||
@@ -20,5 +21,6 @@
|
|||||||
:download-count="$download->count"
|
:download-count="$download->count"
|
||||||
:episode-number="$hdl->episode"
|
:episode-number="$hdl->episode"
|
||||||
:fill-numbers="$fillNumbers"
|
:fill-numbers="$fillNumbers"
|
||||||
:file-size="$download->getFileSize()">
|
:file-size="$download->getFileSize()"
|
||||||
|
:version="$version">
|
||||||
@endif
|
@endif
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
$now = \Illuminate\Support\Carbon::now();
|
$now = \Illuminate\Support\Carbon::now();
|
||||||
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
||||||
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
||||||
|
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||||
|
|
||||||
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
||||||
@endphp
|
@endphp
|
||||||
@@ -20,5 +21,6 @@
|
|||||||
:download-count="$download->count"
|
:download-count="$download->count"
|
||||||
:episode-number="$hdl->episode"
|
:episode-number="$hdl->episode"
|
||||||
:fill-numbers="$fillNumbers"
|
:fill-numbers="$fillNumbers"
|
||||||
:file-size="$download->getFileSize()">
|
:file-size="$download->getFileSize()"
|
||||||
|
:version="$version">
|
||||||
@endif
|
@endif
|
||||||
+5
-3
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use Illuminate\Support\Facades\Schedule;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -14,6 +15,7 @@ use Illuminate\Support\Facades\Artisan;
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Artisan::command('inspire', function () {
|
Schedule::command('app:auto-stats')->hourly();
|
||||||
$this->comment(Inspiring::quote());
|
Schedule::command('app:reset-user-downloads')->daily();
|
||||||
})->purpose('Display an inspiring quote');
|
Schedule::command('app:generate-sitemap')->daily();
|
||||||
|
Schedule::command('app:sync-subscription-keys')->daily();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ export default defineConfig({
|
|||||||
'resources/js/admin-edit.js',
|
'resources/js/admin-edit.js',
|
||||||
'resources/js/admin-subtitles.js',
|
'resources/js/admin-subtitles.js',
|
||||||
'resources/js/preview.js',
|
'resources/js/preview.js',
|
||||||
'resources/js/responsive.js',
|
|
||||||
'resources/js/stats.js'
|
'resources/js/stats.js'
|
||||||
],
|
],
|
||||||
refresh: true,
|
refresh: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user