diff --git a/web/src/lib/components/download-movie-dialog.svelte b/web/src/lib/components/download-movie-dialog.svelte index d505d2d..6f318e4 100644 --- a/web/src/lib/components/download-movie-dialog.svelte +++ b/web/src/lib/components/download-movie-dialog.svelte @@ -38,8 +38,15 @@ }, credentials: 'include' }); + if (response.status === 409) { + const errorMessage = `There already is a Movie File using the Filepath Suffix '${filePathSuffix}'. Try again with a different Filepath Suffix.`; + console.warn(errorMessage); + torrentsError = errorMessage; + if (dialogueState) toast.info(errorMessage); + return []; + } - if (!response.ok) { + if (!response.ok && response.status !== 409) { const errorMessage = `Failed to download torrent for movie ${movie.id}: ${response.statusText}`; console.error(errorMessage); torrentsError = errorMessage; diff --git a/web/src/lib/components/download-season-dialog.svelte b/web/src/lib/components/download-season-dialog.svelte index eaeb5d3..217da8f 100644 --- a/web/src/lib/components/download-season-dialog.svelte +++ b/web/src/lib/components/download-season-dialog.svelte @@ -45,7 +45,15 @@ credentials: 'include' }); - if (!response.ok) { + if (response.status === 409) { + const errorMessage = `There already is a Season File using the Filepath Suffix '${filePathSuffix}'. Try again with a different Filepath Suffix.`; + console.warn(errorMessage); + torrentsError = errorMessage; + if (dialogueState) toast.info(errorMessage); + return []; + } + + if (!response.ok && response.status !== 409) { const errorMessage = `Failed to download torrent for show ${show.id} and season ${selectedSeasonNumber}: ${response.statusText}`; console.error(errorMessage); torrentsError = errorMessage; @@ -53,6 +61,8 @@ return false; } + + const data: PublicIndexerQueryResult[] = await response.json(); console.log('Downloading torrent:', data); toast.success('Torrent download started successfully!');