From 3bbeb8f27a1b12cd4f4ec9ab8c0ed7a6eed69612 Mon Sep 17 00:00:00 2001 From: Nishantsingh11 Date: Sun, 20 Apr 2025 07:56:44 +0530 Subject: [PATCH 1/4] fix(AIFF is supported, but AIF isn't) --- server/utils/globals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/globals.js b/server/utils/globals.js index 5a5bd9513..713b180f6 100644 --- a/server/utils/globals.js +++ b/server/utils/globals.js @@ -1,6 +1,6 @@ const globals = { SupportedImageTypes: ['png', 'jpg', 'jpeg', 'webp'], - SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpg', 'mpeg'], + SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'aif', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpg', 'mpeg'], SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'], TextFileTypes: ['txt', 'nfo'], MetadataFileTypes: ['opf', 'abs', 'xml', 'json'] From 7e69713683cd4b449bdb3a94ee7ab5649c64b1cf Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sat, 19 Apr 2025 23:13:38 -0700 Subject: [PATCH 2/4] Change: chapter lookup to be in modal --- client/pages/audiobook/_id/chapters.vue | 24 ++++++++++++++++++------ client/strings/en-us.json | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client/pages/audiobook/_id/chapters.vue b/client/pages/audiobook/_id/chapters.vue index 7b56f5c95..da33eba0b 100644 --- a/client/pages/audiobook/_id/chapters.vue +++ b/client/pages/audiobook/_id/chapters.vue @@ -141,10 +141,21 @@
-
- - - {{ $strings.ButtonSearch }} +
+
+
+ + + {{ $strings.ButtonSearch }} +
+ +
+

{{ asinError }}

+

{{ $strings.MessageAsinCheck }}

+
+ + +
@@ -249,6 +260,7 @@ export default { findingChapters: false, showFindChaptersModal: false, chapterData: null, + asinError: null, showSecondInputs: false, audibleRegions: ['US', 'CA', 'UK', 'AU', 'FR', 'DE', 'JP', 'IT', 'IN', 'ES'], hasChanges: false @@ -546,14 +558,14 @@ export default { this.findingChapters = true this.chapterData = null + this.asinError = null // used to show warning about audible vs amazon ASIN this.$axios .$get(`/api/search/chapters?asin=${this.asinInput}®ion=${this.regionInput}`) .then((data) => { this.findingChapters = false if (data.error) { - this.$toast.error(data.error) - this.showFindChaptersModal = false + this.asinError = data.error } else { console.log('Chapter data', data) this.chapterData = data diff --git a/client/strings/en-us.json b/client/strings/en-us.json index ef43d4f5f..94bb9f551 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -705,6 +705,7 @@ "LabelYourProgress": "Your Progress", "MessageAddToPlayerQueue": "Add to player queue", "MessageAppriseDescription": "To use this feature you will need to have an instance of Apprise API running or an api that will handle those same requests.
The Apprise API Url should be the full URL path to send the notification, e.g., if your API instance is served at http://192.168.1.1:8337 then you would put http://192.168.1.1:8337/notify.", + "MessageAsinCheck": "Ensure you are using the ASIN from the correct Audible region, not Amazon.", "MessageBackupsDescription": "Backups include users, user progress, library item details, server settings, and images stored in /metadata/items & /metadata/authors. Backups do not include any files stored in your library folders.", "MessageBackupsLocationEditNote": "Note: Updating the backup location will not move or modify existing backups", "MessageBackupsLocationNoEditNote": "Note: The backup location is set through an environment variable and cannot be changed here.", From 79fe064c4a313d11d95f2b4ff70af15949cce21c Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sat, 19 Apr 2025 23:25:17 -0700 Subject: [PATCH 3/4] Add: server localization for chapter lookup --- client/pages/audiobook/_id/chapters.vue | 2 +- client/strings/en-us.json | 2 ++ server/controllers/SearchController.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/pages/audiobook/_id/chapters.vue b/client/pages/audiobook/_id/chapters.vue index da33eba0b..55f74b5c2 100644 --- a/client/pages/audiobook/_id/chapters.vue +++ b/client/pages/audiobook/_id/chapters.vue @@ -565,7 +565,7 @@ export default { this.findingChapters = false if (data.error) { - this.asinError = data.error + this.asinError = this.$getString(data.stringKey) } else { console.log('Chapter data', data) this.chapterData = data diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 94bb9f551..2bf70b53c 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -724,6 +724,7 @@ "MessageChapterErrorStartGteDuration": "Invalid start time must be less than audiobook duration", "MessageChapterErrorStartLtPrev": "Invalid start time must be greater than or equal to previous chapter start time", "MessageChapterStartIsAfter": "Chapter start is after the end of your audiobook", + "MessageChaptersNotFound": "Chapters not found", "MessageCheckingCron": "Checking cron...", "MessageConfirmCloseFeed": "Are you sure you want to close this feed?", "MessageConfirmDeleteBackup": "Are you sure you want to delete backup for {0}?", @@ -780,6 +781,7 @@ "MessageForceReScanDescription": "will scan all files again like a fresh scan. Audio file ID3 tags, OPF files, and text files will be scanned as new.", "MessageImportantNotice": "Important Notice!", "MessageInsertChapterBelow": "Insert chapter below", + "MessageInvalidAsin": "Invalid ASIN", "MessageItemsSelected": "{0} items selected", "MessageItemsUpdated": "{0} items updated", "MessageJoinUsOn": "Join us on", diff --git a/server/controllers/SearchController.js b/server/controllers/SearchController.js index 51aaa910c..bb3382f71 100644 --- a/server/controllers/SearchController.js +++ b/server/controllers/SearchController.js @@ -108,12 +108,12 @@ class SearchController { async findChapters(req, res) { const asin = req.query.asin if (!isValidASIN(asin.toUpperCase())) { - return res.json({ error: 'Invalid ASIN' }) + return res.json({ error: 'Invalid ASIN', stringKey: 'MessageInvalidAsin' }) } const region = (req.query.region || 'us').toLowerCase() const chapterData = await BookFinder.findChapters(asin, region) if (!chapterData) { - return res.json({ error: 'Chapters not found' }) + return res.json({ error: 'Chapters not found', stringKey: 'MessageChaptersNotFound' }) } res.json(chapterData) } From e6264540af7e6366d14df66672566e8f0c668067 Mon Sep 17 00:00:00 2001 From: Nishantsingh11 Date: Sun, 20 Apr 2025 18:34:33 +0530 Subject: [PATCH 4/4] constants.js in server/utils and client/plugins updated. --- client/plugins/constants.js | 2 +- server/utils/constants.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/plugins/constants.js b/client/plugins/constants.js index 90c40b8c4..8c71c1b8d 100644 --- a/client/plugins/constants.js +++ b/client/plugins/constants.js @@ -1,6 +1,6 @@ const SupportedFileTypes = { image: ['png', 'jpg', 'jpeg', 'webp'], - audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpeg', 'mpg'], + audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'aif','wav', 'webm', 'webma', 'mka', 'awb', 'caf', 'mpeg', 'mpg'], ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'], info: ['nfo'], text: ['txt'], diff --git a/server/utils/constants.js b/server/utils/constants.js index dd52e2e1b..cc5217f41 100644 --- a/server/utils/constants.js +++ b/server/utils/constants.js @@ -45,6 +45,7 @@ module.exports.AudioMimeType = { FLAC: 'audio/flac', WMA: 'audio/x-ms-wma', AIFF: 'audio/x-aiff', + AIF: 'audio/x-aiff', WEBM: 'audio/webm', WEBMA: 'audio/webm', MKA: 'audio/x-matroska',