fix: shows season/episode in download list
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
namespace App\Download\Framework\Entity;
|
namespace App\Download\Framework\Entity;
|
||||||
|
|
||||||
use App\Download\Framework\Repository\DownloadRepository;
|
use App\Download\Framework\Repository\DownloadRepository;
|
||||||
|
use App\Torrentio\Result\ResultFactory;
|
||||||
|
use App\Torrentio\Result\TorrentioResult;
|
||||||
use App\User\Framework\Entity\User;
|
use App\User\Framework\Entity\User;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Nihilarr\PTN;
|
||||||
use Symfony\UX\Turbo\Attribute\Broadcast;
|
use Symfony\UX\Turbo\Attribute\Broadcast;
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: DownloadRepository::class)]
|
#[ORM\Entity(repositoryClass: DownloadRepository::class)]
|
||||||
@@ -162,4 +165,16 @@ class Download
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPtn(): object
|
||||||
|
{
|
||||||
|
$ptn = (object) (new PTN())->parse($this->filename);
|
||||||
|
|
||||||
|
if ($this->mediaType === "tvshows") {
|
||||||
|
$ptn->season = str_pad($ptn->season, 2, "0", STR_PAD_LEFT);
|
||||||
|
$ptn->episode = str_pad($ptn->episode, 2, "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ptn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<tr{{ attributes }} id="ad_download_{{ download.id }}">
|
<tr{{ attributes }} id="ad_download_{{ download.id }}">
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 truncate">
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 truncate">
|
||||||
{{ download.title }}
|
{{ download.title }}
|
||||||
|
|
||||||
|
{% if download.mediaType == "tvshows" %}
|
||||||
|
(S{{ download.ptn.season }}E{{ download.ptn.episode }})
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{% if isWidget == false %}
|
{% if isWidget == false %}
|
||||||
|
|||||||
Reference in New Issue
Block a user