improve error message that appears when trying to add duplicate filepath suffix for a season/movie file

This commit is contained in:
maxDorninger
2025-07-29 13:02:50 +02:00
parent e6319c8893
commit 575efddf53
2 changed files with 19 additions and 2 deletions

View File

@@ -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;

View File

@@ -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!');