diff --git a/web/src/lib/components/download-season-dialog.svelte b/web/src/lib/components/download-season-dialog.svelte index 97b337f..5415488 100644 --- a/web/src/lib/components/download-season-dialog.svelte +++ b/web/src/lib/components/download-season-dialog.svelte @@ -12,6 +12,7 @@ import client from '$lib/api'; import type { components } from '$lib/api/api'; import SelectFilePathSuffixDialog from '$lib/components/select-file-path-suffix-dialog.svelte'; + import { invalidateAll } from '$app/navigation'; let { show }: { show: components['schemas']['Show'] } = $props(); let dialogueState = $state(false); @@ -41,17 +42,15 @@ console.warn(errorMessage); torrentsError = errorMessage; if (dialogueState) toast.info(errorMessage); - return false; } else if (!response.ok) { const errorMessage = `Failed to download torrent for show ${show.id} and season ${selectedSeasonNumber}: ${response.statusText}`; console.error(errorMessage); torrentsError = errorMessage; toast.error(errorMessage); - return false; } else { toast.success('Torrent download started successfully!'); - return true; } + await invalidateAll(); } async function search() { diff --git a/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte b/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte index a036386..0d0d35e 100644 --- a/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte +++ b/web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte @@ -16,7 +16,7 @@ import * as Card from '$lib/components/ui/card/index.js'; import DeleteMediaDialog from '$lib/components/delete-media-dialog.svelte'; - let movie: components['schemas']['PublicMovie'] = page.data.movie; + let movie: components['schemas']['PublicMovie'] = $derived(page.data.movie); let user: () => components['schemas']['UserRead'] = getContext('user'); diff --git a/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte b/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte index 301912f..20e592b 100644 --- a/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte +++ b/web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte @@ -23,22 +23,22 @@ import { resolve } from '$app/paths'; import client from '$lib/api'; - let show: () => components['schemas']['PublicShow'] = getContext('show'); + let show: components['schemas']['PublicShow'] = $derived(page.data.showData); + let torrents: components['schemas']['RichShowTorrent'] = $derived(page.data.torrentsData); let user: () => components['schemas']['UserRead'] = getContext('user'); - let torrents: components['schemas']['RichShowTorrent'] = page.data.torrentsData; - let continuousDownloadEnabled = $state(show().continuous_download); + let continuousDownloadEnabled = $state(show.continuous_download); async function toggle_continuous_download() { const { response } = await client.POST('/api/v1/tv/shows/{show_id}/continuousDownload', { params: { - path: { show_id: show().id }, + path: { show_id: show.id }, query: { continuous_download: !continuousDownloadEnabled } } }); console.log( 'Toggling continuous download for show', - show().name, + show.name, 'to', !continuousDownloadEnabled ); @@ -53,10 +53,10 @@ - {getFullyQualifiedMediaName(show())} - MediaManager + {getFullyQualifiedMediaName(show)} - MediaManager @@ -81,20 +81,20 @@