Add an indicator for v2 releases in the download popup #7

This commit is contained in:
2026-05-26 14:36:21 +02:00
parent 2f3f0edc30
commit 5dc1bff60c
5 changed files with 29 additions and 5 deletions
+10
View File
@@ -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)
@@ -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