Compare commits
4 Commits
2f3f0edc30
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f8022b3f18 | |||
| 57d1ec34c3 | |||
| 81639aaabf | |||
| 5dc1bff60c |
@@ -16,7 +16,7 @@ class GenerateSitemap extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'sitemap:generate';
|
||||
protected $signature = 'app:generate-sitemap';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
||||
@@ -8,6 +8,7 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SyncSubscriptionKeys extends Command
|
||||
{
|
||||
@@ -83,8 +84,11 @@ class SyncSubscriptionKeys extends Command
|
||||
->whereNotIn('subscription_key', $activeKeys)
|
||||
->chunk(100, function ($users) {
|
||||
foreach($users as $user) {
|
||||
if ($user->hasRole(UserRole::SUPPORTER)) {
|
||||
Log::info("Removed Supporter Role from {$user->name}");
|
||||
$user->removeRole(UserRole::SUPPORTER);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -95,8 +99,11 @@ class SyncSubscriptionKeys extends Command
|
||||
->whereIn('subscription_key', $activeKeys)
|
||||
->chunk(100, function ($users) {
|
||||
foreach($users as $user) {
|
||||
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 $version = '';
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (str_contains($this->downloadUrl, '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)
|
||||
|
||||
Generated
+9
-9
@@ -3188,6 +3188,15 @@
|
||||
"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": {
|
||||
"version": "1.0.41",
|
||||
"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",
|
||||
"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
|
||||
"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">
|
||||
@include('home.partials.comments')
|
||||
</div>
|
||||
|
||||
@vite(['resources/js/responsive.js'])
|
||||
</x-app-layout>
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
@php
|
||||
$random = \cache()->remember('random_home', 300, function () {
|
||||
return \App\Models\Episode::inRandomOrder()->limit(7)->get(); ;
|
||||
return \App\Models\Episode::inRandomOrder()->limit(16)->get(); ;
|
||||
});
|
||||
@endphp
|
||||
|
||||
<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>
|
||||
|
||||
@@ -1,23 +1,34 @@
|
||||
@props([
|
||||
'isThumbnail',
|
||||
'rowsCount' => 2,
|
||||
])
|
||||
@props(['isThumbnail'])
|
||||
|
||||
@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
|
||||
$limit = 24;
|
||||
$limit = 16;
|
||||
|
||||
$view = $isThumbnail ? 'thumbnail' : 'poster';
|
||||
@endphp
|
||||
|
||||
@if ($isThumbnail)
|
||||
<div
|
||||
class="episode-grid grid {{ $gridClasses }}"
|
||||
data-rows="{{ $rowsCount }}"
|
||||
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
|
||||
[&>.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)
|
||||
@php
|
||||
$episode = isset($popularView)
|
||||
|
||||
@@ -8,10 +8,18 @@
|
||||
</div>
|
||||
<div class="flex flex-col text-center w-full">
|
||||
@if($fillNumbers)
|
||||
@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
|
||||
@if($version)
|
||||
<p class="text-lg">Episode {{ $episodeNumber }} ({{ $version }})</p>
|
||||
@else
|
||||
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
||||
@endif
|
||||
@endif
|
||||
<p class="text-xs">{{ $fileExtension }} MKV {{ $fileSize ?? '' }}</p>
|
||||
<p class="text-xs" id="count-{{ $downloadId }}">Downloaded {{ $downloadCount }} times</p>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
@php
|
||||
$download = $hdl->getDownloadByType('FHDi');
|
||||
$downloadURL = $dldomains[array_rand($dldomains)].'/'.$download->url;
|
||||
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||
@endphp
|
||||
|
||||
<livewire:download-button
|
||||
@@ -14,5 +15,6 @@
|
||||
:download-count="$download->count"
|
||||
:episode-number="$hdl->episode"
|
||||
:fill-numbers="$fillNumbers"
|
||||
:file-size="$download->getFileSize()">
|
||||
:file-size="$download->getFileSize()"
|
||||
:version="$version">
|
||||
@endif
|
||||
@@ -10,6 +10,7 @@
|
||||
$now = \Illuminate\Support\Carbon::now();
|
||||
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
||||
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
||||
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||
|
||||
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
||||
@endphp
|
||||
@@ -20,5 +21,6 @@
|
||||
:download-count="$download->count"
|
||||
:episode-number="$hdl->episode"
|
||||
:fill-numbers="$fillNumbers"
|
||||
:file-size="$download->getFileSize()">
|
||||
:file-size="$download->getFileSize()"
|
||||
:version="$version">
|
||||
@endif
|
||||
@@ -10,6 +10,7 @@
|
||||
$now = \Illuminate\Support\Carbon::now();
|
||||
$expire = \Illuminate\Support\Facades\Crypt::encryptString($now->addHours(6));
|
||||
$file = \Illuminate\Support\Facades\Crypt::encryptString('hentai/'.$download->url);
|
||||
$version = str_contains($download->url, 'v2') ? 'v2' : '';
|
||||
|
||||
$downloadURL = $dlpdomains[array_rand($dlpdomains)].'/download/'.$file.'/'.$expire;
|
||||
@endphp
|
||||
@@ -20,5 +21,6 @@
|
||||
:download-count="$download->count"
|
||||
:episode-number="$hdl->episode"
|
||||
:fill-numbers="$fillNumbers"
|
||||
:file-size="$download->getFileSize()">
|
||||
:file-size="$download->getFileSize()"
|
||||
:version="$version">
|
||||
@endif
|
||||
+5
-3
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -14,6 +15,7 @@ use Illuminate\Support\Facades\Artisan;
|
||||
|
|
||||
*/
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
Schedule::command('app:auto-stats')->hourly();
|
||||
Schedule::command('app:reset-user-downloads')->daily();
|
||||
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-subtitles.js',
|
||||
'resources/js/preview.js',
|
||||
'resources/js/responsive.js',
|
||||
'resources/js/stats.js'
|
||||
],
|
||||
refresh: true,
|
||||
|
||||
Reference in New Issue
Block a user