feat: add links to media detail pages in requests and torrent tables (#352)

Feature Request: https://github.com/maxdorninger/MediaManager/issues/351

[feat: add links to media detail pages in requests and torrent
tables](ac376c0d6d)
This commit is contained in:
just_Bri
2026-02-02 13:48:14 -08:00
committed by GitHub
parent 70ff8f6ace
commit 9e0d0c03c0
7 changed files with 119 additions and 32 deletions

View File

@@ -14,14 +14,19 @@
import DeleteTorrentDialog from '$lib/components/torrents/delete-torrent-dialog.svelte';
import EditTorrentDialog from '$lib/components/torrents/edit-torrent-dialog.svelte';
import { invalidateAll } from '$app/navigation';
import { resolve } from '$app/paths';
let {
torrents,
isShow = true
isShow = true,
showId,
movieId
}: {
torrents:
| components['schemas']['MovieTorrent'][]
| components['schemas']['RichSeasonTorrent'][];
isShow: boolean;
showId?: string;
movieId?: string;
} = $props();
let user: () => components['schemas']['UserRead'] = getContext('user');
@@ -68,7 +73,23 @@
{#each torrents as torrent (torrent.torrent_id)}
<Table.Row>
<Table.Cell class="font-medium">
{torrent.torrent_title}
{#if isShow && showId}
<a
href={resolve('/dashboard/tv/[showId]', { showId })}
class="text-primary hover:underline"
>
{torrent.torrent_title}
</a>
{:else if !isShow && movieId}
<a
href={resolve('/dashboard/movies/[movieId]', { movieId })}
class="text-primary hover:underline"
>
{torrent.torrent_title}
</a>
{:else}
{torrent.torrent_title}
{/if}
</Table.Cell>
{#if isShow}
<Table.Cell>