From 562c30cff45f648dc02281468fb736543ddfa042 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 29 Sep 2024 17:53:52 -0500 Subject: [PATCH] Replace failed to update toasts with one generic string --- client/components/app/BookShelfToolbar.vue | 2 +- client/components/cards/LazyBookCard.vue | 4 ++-- client/components/cards/NotificationCard.vue | 2 +- client/components/modals/AccountModal.vue | 4 ++-- client/components/modals/BookmarksModal.vue | 2 +- .../components/modals/authors/EditModal.vue | 2 +- .../modals/collections/EditModal.vue | 2 +- .../modals/emails/EReaderDeviceModal.vue | 2 +- client/components/modals/item/tabs/Match.vue | 2 +- .../components/modals/libraries/EditModal.vue | 2 +- .../notification/NotificationEditModal.vue | 2 +- .../modals/playlists/AddCreateModal.vue | 4 ++-- .../components/modals/playlists/EditModal.vue | 2 +- .../tables/CollectionBooksTable.vue | 2 +- .../components/tables/PlaylistItemsTable.vue | 2 +- .../tables/playlist/ItemTableRow.vue | 2 +- client/pages/audiobook/_id/chapters.vue | 2 +- client/pages/config/authentication.vue | 2 +- client/pages/config/backups.vue | 2 +- client/pages/config/email.vue | 2 +- client/pages/config/index.vue | 4 ++-- client/pages/config/notifications.vue | 2 +- client/strings/en-us.json | 19 +------------------ 23 files changed, 27 insertions(+), 44 deletions(-) diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index 736e86d3..7ed07abb 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -473,7 +473,7 @@ export default { }) .catch((error) => { console.error('Failed to re-add series to continue listening', error) - this.$toast.error(this.$strings.ToastItemUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processingSeries = false diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 26fb71a8..ae2cdd5b 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -816,7 +816,7 @@ export default { }) .catch((error) => { console.error('Failed to remove series from home', error) - this.$toast.error(this.$strings.ToastFailedToUpdateUser) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processing = false @@ -834,7 +834,7 @@ export default { }) .catch((error) => { console.error('Failed to hide item from home', error) - this.$toast.error(this.$strings.ToastFailedToUpdateUser) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processing = false diff --git a/client/components/cards/NotificationCard.vue b/client/components/cards/NotificationCard.vue index cf959df7..9cfe54cd 100644 --- a/client/components/cards/NotificationCard.vue +++ b/client/components/cards/NotificationCard.vue @@ -130,7 +130,7 @@ export default { }) .catch((error) => { console.error('Failed to update notification', error) - this.$toast.error(this.$strings.ToastNotificationUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.enabling = false diff --git a/client/components/modals/AccountModal.vue b/client/components/modals/AccountModal.vue index 247fd08d..1ea24fd0 100644 --- a/client/components/modals/AccountModal.vue +++ b/client/components/modals/AccountModal.vue @@ -296,7 +296,7 @@ export default { .then((data) => { this.processing = false if (data.error) { - this.$toast.error(`${this.$strings.ToastAccountUpdateFailed}: ${data.error}`) + this.$toast.error(`${this.$strings.ToastFailedToUpdate}: ${data.error}`) } else { console.log('Account updated', data.user) @@ -313,7 +313,7 @@ export default { this.processing = false console.error('Failed to update account', error) var errMsg = error.response ? error.response.data || '' : '' - this.$toast.error(errMsg || this.$strings.ToastFailedToUpdateAccount) + this.$toast.error(errMsg || this.$strings.ToastFailedToUpdate) }) }, submitCreateAccount() { diff --git a/client/components/modals/BookmarksModal.vue b/client/components/modals/BookmarksModal.vue index 53ed7d07..08d800f0 100644 --- a/client/components/modals/BookmarksModal.vue +++ b/client/components/modals/BookmarksModal.vue @@ -110,7 +110,7 @@ export default { this.$toast.success(this.$strings.ToastBookmarkUpdateSuccess) }) .catch((error) => { - this.$toast.error(this.$strings.ToastBookmarkUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) console.error(error) }) this.show = false diff --git a/client/components/modals/authors/EditModal.vue b/client/components/modals/authors/EditModal.vue index d49edd4d..93ec8855 100644 --- a/client/components/modals/authors/EditModal.vue +++ b/client/components/modals/authors/EditModal.vue @@ -148,7 +148,7 @@ export default { var result = await this.$axios.$patch(`/api/authors/${this.authorId}`, updatePayload).catch((error) => { console.error('Failed', error) const errorMsg = error.response ? error.response.data : null - this.$toast.error(errorMsg || this.$strings.ToastAuthorUpdateFailed) + this.$toast.error(errorMsg || this.$strings.ToastFailedToUpdate) return null }) if (result) { diff --git a/client/components/modals/collections/EditModal.vue b/client/components/modals/collections/EditModal.vue index 2ab1b939..8c8d5392 100644 --- a/client/components/modals/collections/EditModal.vue +++ b/client/components/modals/collections/EditModal.vue @@ -135,7 +135,7 @@ export default { .catch((error) => { console.error('Failed to update collection', error) this.processing = false - this.$toast.error(this.$strings.ToastCollectionUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) } }, diff --git a/client/components/modals/emails/EReaderDeviceModal.vue b/client/components/modals/emails/EReaderDeviceModal.vue index 7476dd4b..5261fb55 100644 --- a/client/components/modals/emails/EReaderDeviceModal.vue +++ b/client/components/modals/emails/EReaderDeviceModal.vue @@ -178,7 +178,7 @@ export default { }) .catch((error) => { console.error('Failed to update device', error) - this.$toast.error(this.$strings.ToastDeviceUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processing = false diff --git a/client/components/modals/item/tabs/Match.vue b/client/components/modals/item/tabs/Match.vue index 4cc8d10d..6fe05705 100644 --- a/client/components/modals/item/tabs/Match.vue +++ b/client/components/modals/item/tabs/Match.vue @@ -623,7 +623,7 @@ export default { this.clearSelectedMatch() this.$emit('selectTab', 'details') } else { - this.$toast.error(this.$strings.ToastItemDetailsUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) } } else { this.clearSelectedMatch() diff --git a/client/components/modals/libraries/EditModal.vue b/client/components/modals/libraries/EditModal.vue index 1dd9c92a..73955309 100644 --- a/client/components/modals/libraries/EditModal.vue +++ b/client/components/modals/libraries/EditModal.vue @@ -222,7 +222,7 @@ export default { if (error.response && error.response.data) { this.$toast.error(error.response.data) } else { - this.$toast.error(this.$strings.ToastLibraryUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) } this.processing = false }) diff --git a/client/components/modals/notification/NotificationEditModal.vue b/client/components/modals/notification/NotificationEditModal.vue index afd4d1f9..32fa20ea 100644 --- a/client/components/modals/notification/NotificationEditModal.vue +++ b/client/components/modals/notification/NotificationEditModal.vue @@ -132,7 +132,7 @@ export default { }) .catch((error) => { console.error('Failed to update notification', error) - this.$toast.error(this.$strings.ToastNotificationUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processing = false diff --git a/client/components/modals/playlists/AddCreateModal.vue b/client/components/modals/playlists/AddCreateModal.vue index 3e0c7a9f..e089324f 100644 --- a/client/components/modals/playlists/AddCreateModal.vue +++ b/client/components/modals/playlists/AddCreateModal.vue @@ -135,7 +135,7 @@ export default { }) .catch((error) => { console.error('Failed to remove items from playlist', error) - this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) this.processing = false }) }, @@ -153,7 +153,7 @@ export default { }) .catch((error) => { console.error('Failed to add items to playlist', error) - this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) this.processing = false }) }, diff --git a/client/components/modals/playlists/EditModal.vue b/client/components/modals/playlists/EditModal.vue index b26df65a..cd2deffe 100644 --- a/client/components/modals/playlists/EditModal.vue +++ b/client/components/modals/playlists/EditModal.vue @@ -115,7 +115,7 @@ export default { .catch((error) => { console.error('Failed to update playlist', error) this.processing = false - this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) } }, diff --git a/client/components/tables/CollectionBooksTable.vue b/client/components/tables/CollectionBooksTable.vue index ce66de11..5803889f 100644 --- a/client/components/tables/CollectionBooksTable.vue +++ b/client/components/tables/CollectionBooksTable.vue @@ -78,7 +78,7 @@ export default { }) .catch((error) => { console.error('Failed to update collection', error) - this.$toast.error(this.$strings.ToastCollectionUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) }, editBook(book) { diff --git a/client/components/tables/PlaylistItemsTable.vue b/client/components/tables/PlaylistItemsTable.vue index 09811d4a..a30125d6 100644 --- a/client/components/tables/PlaylistItemsTable.vue +++ b/client/components/tables/PlaylistItemsTable.vue @@ -92,7 +92,7 @@ export default { }) .catch((error) => { console.error('Failed to update playlist', error) - this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) }, init() { diff --git a/client/components/tables/playlist/ItemTableRow.vue b/client/components/tables/playlist/ItemTableRow.vue index f7cc7d7b..9f1a7e87 100644 --- a/client/components/tables/playlist/ItemTableRow.vue +++ b/client/components/tables/playlist/ItemTableRow.vue @@ -223,7 +223,7 @@ export default { }) .catch((error) => { console.error('Failed to remove item from playlist', error) - this.$toast.error(this.$strings.ToastPlaylistUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.processingRemove = false diff --git a/client/pages/audiobook/_id/chapters.vue b/client/pages/audiobook/_id/chapters.vue index 5da4813d..3448479b 100644 --- a/client/pages/audiobook/_id/chapters.vue +++ b/client/pages/audiobook/_id/chapters.vue @@ -499,7 +499,7 @@ export default { .catch((error) => { this.saving = false console.error('Failed to update chapters', error) - this.$toast.error('Failed to update chapters') + this.$toast.error(this.$strings.ToastFailedToUpdate) }) }, applyChapterNamesOnly() { diff --git a/client/pages/config/authentication.vue b/client/pages/config/authentication.vue index 50fa50a4..1f934c88 100644 --- a/client/pages/config/authentication.vue +++ b/client/pages/config/authentication.vue @@ -317,7 +317,7 @@ export default { }) .catch((error) => { console.error('Failed to update server settings', error) - this.$toast.error(this.$strings.ToastServerSettingsUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.savingSettings = false diff --git a/client/pages/config/backups.vue b/client/pages/config/backups.vue index 0c64ddf6..d1dce014 100644 --- a/client/pages/config/backups.vue +++ b/client/pages/config/backups.vue @@ -162,7 +162,7 @@ export default { }) .catch((error) => { console.error('Failed to save backup path', error) - const errorMsg = error.response?.data || this.$strings.ToastBackupPathUpdateFailed + const errorMsg = error.response?.data || this.$strings.ToastFailedToUpdate this.$toast.error(errorMsg) }) .finally(() => { diff --git a/client/pages/config/email.vue b/client/pages/config/email.vue index 212c51f3..e5fd03ba 100644 --- a/client/pages/config/email.vue +++ b/client/pages/config/email.vue @@ -292,7 +292,7 @@ export default { }) .catch((error) => { console.error('Failed to update email settings', error) - this.$toast.error(this.$strings.ToastEmailSettingsUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.savingSettings = false diff --git a/client/pages/config/index.vue b/client/pages/config/index.vue index 1accc743..e335db85 100644 --- a/client/pages/config/index.vue +++ b/client/pages/config/index.vue @@ -290,7 +290,7 @@ export default { }) .catch((error) => { console.error('Failed to update prefixes', error) - this.$toast.error(this.$strings.ToastSortingPrefixesUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.savingPrefixes = false @@ -338,7 +338,7 @@ export default { .catch((error) => { console.error('Failed to update server settings', error) this.updatingServerSettings = false - this.$toast.error(this.$strings.ToastServerSettingsUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) }, initServerSettings() { diff --git a/client/pages/config/notifications.vue b/client/pages/config/notifications.vue index 24ea6a6c..a43a9aed 100644 --- a/client/pages/config/notifications.vue +++ b/client/pages/config/notifications.vue @@ -132,7 +132,7 @@ export default { }) .catch((error) => { console.error('Failed to update notification settings', error) - this.$toast.error(this.$strings.ToastNotificationSettingsUpdateFailed) + this.$toast.error(this.$strings.ToastFailedToUpdate) }) .finally(() => { this.savingSettings = false diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 6da92f6f..2a73a6ac 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -849,14 +849,12 @@ "StatsTopNarrators": "TOP NARRATORS", "StatsTotalDuration": "With a total duration of…", "StatsYearInReview": "YEAR IN REVIEW", - "ToastAccountUpdateFailed": "Failed to update account", "ToastAccountUpdateSuccess": "Account updated", "ToastAppriseUrlRequired": "Must enter an Apprise URL", "ToastAuthorImageRemoveSuccess": "Author image removed", "ToastAuthorNotFound": "Author \"{0}\" not found", "ToastAuthorRemoveSuccess": "Author removed", "ToastAuthorSearchNotFound": "Author not found", - "ToastAuthorUpdateFailed": "Failed to update author", "ToastAuthorUpdateMerged": "Author merged", "ToastAuthorUpdateSuccess": "Author updated", "ToastAuthorUpdateSuccessNoImageFound": "Author updated (no image found)", @@ -867,7 +865,6 @@ "ToastBackupDeleteSuccess": "Backup deleted", "ToastBackupInvalidMaxKeep": "Invalid number of backups to keep", "ToastBackupInvalidMaxSize": "Invalid maximum backup size", - "ToastBackupPathUpdateFailed": "Failed to update backup path", "ToastBackupRestoreFailed": "Failed to restore backup", "ToastBackupUploadFailed": "Failed to upload backup", "ToastBackupUploadSuccess": "Backup uploaded", @@ -878,7 +875,6 @@ "ToastBookmarkCreateFailed": "Failed to create bookmark", "ToastBookmarkCreateSuccess": "Bookmark added", "ToastBookmarkRemoveSuccess": "Bookmark removed", - "ToastBookmarkUpdateFailed": "Failed to update bookmark", "ToastBookmarkUpdateSuccess": "Bookmark updated", "ToastCachePurgeFailed": "Failed to purge cache", "ToastCachePurgeSuccess": "Cache purged successfully", @@ -889,7 +885,6 @@ "ToastCollectionItemsAddSuccess": "Item(s) added to collection success", "ToastCollectionItemsRemoveSuccess": "Item(s) removed from collection", "ToastCollectionRemoveSuccess": "Collection removed", - "ToastCollectionUpdateFailed": "Failed to update collection", "ToastCollectionUpdateSuccess": "Collection updated", "ToastCoverUpdateFailed": "Cover update failed", "ToastDeleteFileFailed": "Failed to delete file", @@ -898,8 +893,6 @@ "ToastDeviceNameAlreadyExists": "Ereader device with that name already exists", "ToastDeviceTestEmailFailed": "Failed to send test email", "ToastDeviceTestEmailSuccess": "Test email sent", - "ToastDeviceUpdateFailed": "Failed to update device", - "ToastEmailSettingsUpdateFailed": "Failed to update email settings", "ToastEmailSettingsUpdateSuccess": "Email settings updated", "ToastEncodeCancelFailed": "Failed to cancel encode", "ToastEncodeCancelSucces": "Encode canceled", @@ -907,22 +900,18 @@ "ToastEpisodeDownloadQueueClearSuccess": "Episode download queue cleared", "ToastErrorCannotShare": "Cannot share natively on this device", "ToastFailedToLoadData": "Failed to load data", + "ToastFailedToUpdate": "Failed to update", "ToastFailedToShare": "Failed to share", - "ToastFailedToUpdateAccount": "Failed to update account", - "ToastFailedToUpdateUser": "Failed to update user", "ToastInvalidImageUrl": "Invalid image URL", "ToastInvalidUrl": "Invalid URL", - "ToastItemCoverUpdateFailed": "Failed to update item cover", "ToastItemCoverUpdateSuccess": "Item cover updated", "ToastItemDeletedFailed": "Failed to delete item", "ToastItemDeletedSuccess": "Deleted item", - "ToastItemDetailsUpdateFailed": "Failed to update item details", "ToastItemDetailsUpdateSuccess": "Item details updated", "ToastItemMarkedAsFinishedFailed": "Failed to mark as Finished", "ToastItemMarkedAsFinishedSuccess": "Item marked as Finished", "ToastItemMarkedAsNotFinishedFailed": "Failed to mark as Not Finished", "ToastItemMarkedAsNotFinishedSuccess": "Item marked as Not Finished", - "ToastItemUpdateFailed": "Failed to update item", "ToastItemUpdateSuccess": "Item updated", "ToastLibraryCreateFailed": "Failed to create library", "ToastLibraryCreateSuccess": "Library \"{0}\" created", @@ -930,7 +919,6 @@ "ToastLibraryDeleteSuccess": "Library deleted", "ToastLibraryScanFailedToStart": "Failed to start scan", "ToastLibraryScanStarted": "Library scan started", - "ToastLibraryUpdateFailed": "Failed to update library", "ToastLibraryUpdateSuccess": "Library \"{0}\" updated", "ToastNameEmailRequired": "Name and email are required", "ToastNameRequired": "Name is required", @@ -945,16 +933,13 @@ "ToastNotificationDeleteFailed": "Failed to delete notification", "ToastNotificationFailedMaximum": "Max failed attempts must be >= 0", "ToastNotificationQueueMaximum": "Max notification queue must be >= 0", - "ToastNotificationSettingsUpdateFailed": "Failed to update notification settings", "ToastNotificationSettingsUpdateSuccess": "Notification settings updated", "ToastNotificationTestTriggerFailed": "Failed to trigger test notification", "ToastNotificationTestTriggerSuccess": "Triggered test notification", - "ToastNotificationUpdateFailed": "Failed to update notification", "ToastNotificationUpdateSuccess": "Notification updated", "ToastPlaylistCreateFailed": "Failed to create playlist", "ToastPlaylistCreateSuccess": "Playlist created", "ToastPlaylistRemoveSuccess": "Playlist removed", - "ToastPlaylistUpdateFailed": "Failed to update playlist", "ToastPlaylistUpdateSuccess": "Playlist updated", "ToastPodcastCreateFailed": "Failed to create podcast", "ToastPodcastCreateSuccess": "Podcast created successfully", @@ -983,7 +968,6 @@ "ToastSendEbookToDeviceSuccess": "Ebook sent to device \"{0}\"", "ToastSeriesUpdateFailed": "Series update failed", "ToastSeriesUpdateSuccess": "Series update success", - "ToastServerSettingsUpdateFailed": "Failed to update server settings", "ToastServerSettingsUpdateSuccess": "Server settings updated", "ToastSessionCloseFailed": "Failed to close session", "ToastSessionDeleteFailed": "Failed to delete session", @@ -994,7 +978,6 @@ "ToastSocketDisconnected": "Socket disconnected", "ToastSocketFailedToConnect": "Socket failed to connect", "ToastSortingPrefixesEmptyError": "Must have at least 1 sorting prefix", - "ToastSortingPrefixesUpdateFailed": "Failed to update sorting prefixes", "ToastSortingPrefixesUpdateSuccess": "Sorting prefixes updated ({0} items)", "ToastTitleRequired": "Title is required", "ToastUnknownError": "Unknown error",