Display the correct file extension on download button
This commit is contained in:
@@ -21,6 +21,15 @@ class DownloadButton extends Component
|
|||||||
|
|
||||||
public $background = 'bg-rose-600';
|
public $background = 'bg-rose-600';
|
||||||
|
|
||||||
|
public $fileExtension = 'HEVC';
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
if (str_contains($this->downloadUrl, 'AV1')) {
|
||||||
|
$this->fileExtension = 'AV1';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function clicked($downloadId)
|
public function clicked($downloadId)
|
||||||
{
|
{
|
||||||
$download = Downloads::find($downloadId);
|
$download = Downloads::find($downloadId);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
@else
|
@else
|
||||||
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
||||||
@endif
|
@endif
|
||||||
<p class="text-xs">HEVC 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>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -235,6 +235,11 @@
|
|||||||
'/' .
|
'/' .
|
||||||
$expire;
|
$expire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($download->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<a href="{{ $downloadURL }}" wire:click="clicked({{ $download->id }})"
|
<a href="{{ $downloadURL }}" wire:click="clicked({{ $download->id }})"
|
||||||
download>
|
download>
|
||||||
@@ -249,7 +254,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col text-center w-full">
|
<div class="flex flex-col text-center w-full">
|
||||||
<p class="text-xs">HEVC MKV</p>
|
<p class="text-xs">{{ $fileExtension }} MKV</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<a href="{{ $dldomains[array_rand($dldomains)] }}/{{ $hdl->getDownloadByType('FHD')->url }}">
|
<a href="{{ $dldomains[array_rand($dldomains)] }}/{{ $hdl->getDownloadByType('FHD')->url }}">
|
||||||
|
@php
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($hdl->getDownloadByType('FHD')->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<button class="group rounded-md shadow bg-rose-600 text-white cursor-pointer flex justify-between items-center overflow-hidden transition-all hover:glow m-1 w-[150px]">
|
<button class="group rounded-md shadow bg-rose-600 text-white cursor-pointer flex justify-between items-center overflow-hidden transition-all hover:glow m-1 w-[150px]">
|
||||||
<div class="relative w-12 h-12 bg-white bg-opacity-20 text-white flex justify-center items-center transition-all"><svg id="arrow" class="w-4 h-4 transition-all group-hover:-translate-y-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<div class="relative w-12 h-12 bg-white bg-opacity-20 text-white flex justify-center items-center transition-all"><svg id="arrow" class="w-4 h-4 transition-all group-hover:-translate-y-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
||||||
@@ -7,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="w-32 text-center">
|
<div class="w-32 text-center">
|
||||||
<p class="px-5 text-sm row-span-2">Episode {{ $hdl->episode }}</p>
|
<p class="px-5 text-sm row-span-2">Episode {{ $hdl->episode }}</p>
|
||||||
<p class="px-5 text-xs">HEVC MKV</p>
|
<p class="px-5 text-xs">{{ $fileExtension }} MKV</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -28,9 +28,15 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
@php
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($episode->getDownloadByType('FHD')->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<div class="flex flex-col text-center w-full">
|
<div class="flex flex-col text-center w-full">
|
||||||
<p class="text-xl">Episode {{ $episode->episode }}</p>
|
<p class="text-xl">Episode {{ $episode->episode }}</p>
|
||||||
<p class="text-xs">HEVC MKV {{ $episode->getDownloadByType('FHD')->getFileSize() ?? '' }}</p>
|
<p class="text-xs">{{ $fileExtension }} MKV {{ $episode->getDownloadByType('FHD')->getFileSize() ?? '' }}</p>
|
||||||
<p class="text-xs" id="downloadCount">Downloaded {{ $episode->getDownloadByType('FHD')->count }} times</p>
|
<p class="text-xs" id="downloadCount">Downloaded {{ $episode->getDownloadByType('FHD')->count }} times</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user