mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 12:55:33 +02:00
improve error message that appears when trying to add duplicate filepath suffix for a season/movie file
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user