fix: links to series from monitor list row

This commit is contained in:
2025-06-12 19:57:39 -05:00
parent 9b3506ab17
commit 937313fe59
2 changed files with 18 additions and 1 deletions

View File

@@ -19,6 +19,19 @@ class MonitorExtension
return $types[$type] ?? '-';
}
#[AsTwigFilter('as_download_type')]
public function monitorTypeToDownloadType(string $type)
{
$types = [
'tvshows' => 'tvshows',
'tvseason' => 'tvshows',
'tvepisode' => 'tvshows',
'movie' => 'movies',
];
return $types[$type] ?? '-';
}
#[AsTwigFilter('monitor_media_id')]
public function mediaId(Monitor $monitor)
{

View File

@@ -1,6 +1,10 @@
<tr{{ attributes }} id="monitor_{{ monitor.id }}" class="hover:bg-gray-200">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate">
{{ monitor.title }}
<a href="{{ path('app_search_result', {imdbId: monitor.imdbId, mediaType: monitor.monitorType|as_download_type}) }}"
class="mr-1 hover:underline rounded-md"
>
{{ monitor.title }}
</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
{{ monitor|monitor_media_id }}