From db01db3a2bd8e832927eb32e856ba93dd38bfe9a Mon Sep 17 00:00:00 2001 From: Mark Cooper Date: Fri, 17 Sep 2021 18:40:30 -0500 Subject: [PATCH] Missing audiobooks flagged not deleted, fix close progress loop on stream errors, clickable download toast, consolidate duplicate track error log, improved scanner to ignore non-audio files --- client/components/cards/BookCard.vue | 8 ++- client/components/modals/EditModal.vue | 4 ++ client/components/modals/edit-tabs/Tracks.vue | 10 +++- client/components/ui/IconBtn.vue | 5 +- client/components/ui/Tooltip.vue | 9 ++- client/layouts/default.vue | 26 ++++---- client/package.json | 2 +- client/pages/audiobook/_id/index.vue | 13 +++- package.json | 2 +- server/Scanner.js | 60 +++++++++++-------- server/Server.js | 1 - server/objects/Audiobook.js | 14 ++++- server/objects/Stream.js | 2 + server/utils/audioFileScanner.js | 15 ++++- server/utils/scandir.js | 46 ++++++++++++-- 15 files changed, 157 insertions(+), 60 deletions(-) diff --git a/client/components/cards/BookCard.vue b/client/components/cards/BookCard.vue index 54937a90c5..fe97813ca9 100644 --- a/client/components/cards/BookCard.vue +++ b/client/components/cards/BookCard.vue @@ -14,7 +14,7 @@
-
+
play_circle_filled
@@ -132,7 +132,10 @@ export default { return this.userProgress ? !!this.userProgress.isRead : false }, showError() { - return this.hasMissingParts || this.hasInvalidParts + return this.hasMissingParts || this.hasInvalidParts || this.isMissing + }, + isMissing() { + return this.audiobook.isMissing }, hasMissingParts() { return this.audiobook.hasMissingParts @@ -141,6 +144,7 @@ export default { return this.audiobook.hasInvalidParts }, errorText() { + if (this.isMissing) return 'Audiobook directory is missing!' var txt = '' if (this.hasMissingParts) { txt = `${this.hasMissingParts} missing parts.` diff --git a/client/components/modals/EditModal.vue b/client/components/modals/EditModal.vue index a4fbbc201b..246f1a4f1f 100644 --- a/client/components/modals/EditModal.vue +++ b/client/components/modals/EditModal.vue @@ -109,6 +109,7 @@ export default { availableTabs() { if (!this.userCanUpdate && !this.userCanDownload) return [] return this.tabs.filter((tab) => { + if (tab.id === 'download' && this.isMissing) return false if ((tab.id === 'download' || tab.id === 'tracks') && this.userCanDownload) return true if (tab.id !== 'download' && tab.id !== 'tracks' && this.userCanUpdate) return true return false @@ -122,6 +123,9 @@ export default { var _tab = this.tabs.find((t) => t.id === this.selectedTab) return _tab ? _tab.component : '' }, + isMissing() { + return this.selectedAudiobook.isMissing + }, selectedAudiobook() { return this.$store.state.selectedAudiobook || {} }, diff --git a/client/components/modals/edit-tabs/Tracks.vue b/client/components/modals/edit-tabs/Tracks.vue index 91066a1a9d..5f1df56181 100644 --- a/client/components/modals/edit-tabs/Tracks.vue +++ b/client/components/modals/edit-tabs/Tracks.vue @@ -11,7 +11,7 @@ Filename Size Duration - Download + Download