From 59a428d549e6d115875a01ca59c5905fe41dbc87 Mon Sep 17 00:00:00 2001 From: Dr-Blank <64108942+Dr-Blank@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:10:57 -0500 Subject: [PATCH 01/19] more gu translations --- client/strings/gu.json | 137 +++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 72 deletions(-) diff --git a/client/strings/gu.json b/client/strings/gu.json index d71c9f17..9a105722 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -1,10 +1,10 @@ { "ButtonAdd": "ઉમેરો", "ButtonAddChapters": "પ્રકરણો ઉમેરો", - "ButtonAddDevice": "Add Device", - "ButtonAddLibrary": "Add Library", + "ButtonAddDevice": "ઉપકરણ ઉમેરો", + "ButtonAddLibrary": "પુસ્તકાલય ઉમેરો", "ButtonAddPodcasts": "પોડકાસ્ટ ઉમેરો", - "ButtonAddUser": "Add User", + "ButtonAddUser": "વપરાશકર્તા ઉમેરો", "ButtonAddYourFirstLibrary": "તમારી પ્રથમ પુસ્તકાલય ઉમેરો", "ButtonApply": "લાગુ કરો", "ButtonApplyChapters": "પ્રકરણો લાગુ કરો", @@ -58,11 +58,11 @@ "ButtonRemoveAll": "બધું કાઢી નાખો", "ButtonRemoveAllLibraryItems": "બધું પુસ્તકાલય વસ્તુઓ કાઢી નાખો", "ButtonRemoveFromContinueListening": "સાંભળતી પુસ્તકો માંથી કાઢી નાખો", - "ButtonRemoveFromContinueReading": "Remove from Continue Reading", + "ButtonRemoveFromContinueReading": "સાંભળતી પુસ્તકો માંથી કાઢી નાખો", "ButtonRemoveSeriesFromContinueSeries": "સાંભળતી સિરીઝ માંથી કાઢી નાખો", "ButtonReScan": "ફરીથી સ્કેન કરો", "ButtonReset": "રીસેટ કરો", - "ButtonResetToDefault": "Reset to default", + "ButtonResetToDefault": "ડિફોલ્ટ પર રીસેટ કરો", "ButtonRestore": "પુનઃસ્થાપિત કરો", "ButtonSave": "સાચવો", "ButtonSaveAndClose": "સાચવો અને બંધ કરો", @@ -78,7 +78,7 @@ "ButtonStartM4BEncode": "M4B એન્કોડ શરૂ કરો", "ButtonStartMetadataEmbed": "મેટાડેટા એમ્બેડ શરૂ કરો", "ButtonSubmit": "સબમિટ કરો", - "ButtonTest": "Test", + "ButtonTest": "પરખ કરો", "ButtonUpload": "અપલોડ કરો", "ButtonUploadBackup": "બેકઅપ અપલોડ કરો", "ButtonUploadCover": "કવર અપલોડ કરો", @@ -90,72 +90,65 @@ "HeaderAccount": "એકાઉન્ટ", "HeaderAdvanced": "અડ્વાન્સડ", "HeaderAppriseNotificationSettings": "Apprise સૂચના સેટિંગ્સ", - "HeaderAudiobookTools": "Audiobook File Management Tools", - "HeaderAudioTracks": "Audio Tracks", - "HeaderBackups": "Backups", - "HeaderChangePassword": "Change Password", - "HeaderChapters": "Chapters", - "HeaderChooseAFolder": "Choose a Folder", - "HeaderCollection": "Collection", - "HeaderCollectionItems": "Collection Items", - "HeaderCover": "Cover", - "HeaderCurrentDownloads": "Current Downloads", - "HeaderDetails": "Details", - "HeaderDownloadQueue": "Download Queue", - "HeaderEbookFiles": "Ebook Files", - "HeaderEmail": "Email", - "HeaderEmailSettings": "Email Settings", - "HeaderEpisodes": "Episodes", - "HeaderEreaderDevices": "Ereader Devices", - "HeaderEreaderSettings": "Ereader Settings", - "HeaderFiles": "Files", - "HeaderFindChapters": "Find Chapters", - "HeaderIgnoredFiles": "Ignored Files", - "HeaderItemFiles": "Item Files", - "HeaderItemMetadataUtils": "Item Metadata Utils", - "HeaderLastListeningSession": "Last Listening Session", - "HeaderLatestEpisodes": "Latest episodes", - "HeaderLibraries": "Libraries", - "HeaderLibraryFiles": "Library Files", - "HeaderLibraryStats": "Library Stats", - "HeaderListeningSessions": "Listening Sessions", - "HeaderListeningStats": "Listening Stats", - "HeaderLogin": "Login", - "HeaderLogs": "Logs", - "HeaderManageGenres": "Manage Genres", - "HeaderManageTags": "Manage Tags", - "HeaderMapDetails": "Map details", - "HeaderMatch": "Match", - "HeaderMetadataOrderOfPrecedence": "Metadata order of precedence", - "HeaderMetadataToEmbed": "Metadata to embed", - "HeaderNewAccount": "New Account", - "HeaderNewLibrary": "New Library", - "HeaderNotifications": "Notifications", - "HeaderOpenRSSFeed": "Open RSS Feed", - "HeaderOtherFiles": "Other Files", - "HeaderPermissions": "Permissions", - "HeaderPlayerQueue": "Player Queue", - "HeaderPlaylist": "Playlist", - "HeaderPlaylistItems": "Playlist Items", - "HeaderPodcastsToAdd": "Podcasts to Add", - "HeaderPreviewCover": "Preview Cover", - "HeaderRemoveEpisode": "Remove Episode", - "HeaderRemoveEpisodes": "Remove {0} Episodes", - "HeaderRSSFeedGeneral": "RSS Details", - "HeaderRSSFeedIsOpen": "RSS Feed is Open", - "HeaderRSSFeeds": "RSS Feeds", - "HeaderSavedMediaProgress": "Saved Media Progress", - "HeaderSchedule": "Schedule", - "HeaderScheduleLibraryScans": "Schedule Automatic Library Scans", - "HeaderSession": "Session", - "HeaderSetBackupSchedule": "Set Backup Schedule", - "HeaderSettings": "Settings", - "HeaderSettingsDisplay": "Display", - "HeaderSettingsExperimental": "Experimental Features", - "HeaderSettingsGeneral": "General", - "HeaderSettingsScanner": "Scanner", - "HeaderSleepTimer": "Sleep Timer", - "HeaderStatsLargestItems": "Largest Items", + "HeaderAudiobookTools": "ઓડિયોબુક ફાઇલ વ્યવસ્થાપન ટૂલ્સ", + "HeaderAudioTracks": "ઓડિયો ટ્રેક્સ", + "HeaderBackups": "બેકઅપ્સ", + "HeaderChangePassword": "પાસવર્ડ બદલો", + "HeaderChapters": "પ્રકરણો", + "HeaderChooseAFolder": "ફોલ્ડર પસંદ કરો", + "HeaderCollection": "સંગ્રહ", + "HeaderCollectionItems": "સંગ્રહ વસ્તુઓ", + "HeaderCover": "આવરણ", + "HeaderCurrentDownloads": "વર્તમાન ડાઉનલોડ્સ", + "HeaderDetails": "વિગતો", + "HeaderDownloadQueue": "ડાઉનલોડ કતાર", + "HeaderEbookFiles": "ઇબુક ફાઇલો", + "HeaderEmail": "ઈમેલ", + "HeaderEmailSettings": "ઈમેલ સેટિંગ્સ", + "HeaderEpisodes": "એપિસોડ્સ", + "HeaderEreaderDevices": "ઇરીડર ઉપકરણો", + "HeaderEreaderSettings": "ઇરીડર સેટિંગ્સ", + "HeaderFiles": "ફાઇલો", + "HeaderFindChapters": "પ્રકરણો શોધો", + "HeaderIgnoredFiles": "અવગણેલી ફાઇલો", + "HeaderItemFiles": "વાસ્તુ ની ફાઈલો", + "HeaderItemMetadataUtils": "વસ્તુ મેટાડેટા સાધનો", + "HeaderLastListeningSession": "છેલ્લી સાંભળતી સેશન", + "HeaderLatestEpisodes": "નવીનતમ એપિસોડ્સ", + "HeaderLibraries": "પુસ્તકાલયો", + "HeaderLibraryFiles":"પુસ્તકાલય ફાઇલો", + "HeaderLibraryStats": "પુસ્તકાલય આંકડા", + "HeaderListeningSessions": "સાંભળતી સેશન્સ", + "HeaderListeningStats": "સાંભળતી આંકડા", + "HeaderLogin": "લોગિન", + "HeaderLogs": "લોગ્સ", + "HeaderManageGenres": "જાતિઓ મેનેજ કરો", + "HeaderManageTags": "ટેગ્સ મેનેજ કરો", + "HeaderMapDetails": "વિગતો મેપ કરો", + "HeaderMatch": "મેળ ખાતી શોધો", + "HeaderMetadataOrderOfPrecedence": "મેટાડેટા પ્રાધાન્યતાનો ક્રમ", + "HeaderMetadataToEmbed": "એમ્બેડ કરવા માટે મેટાડેટા", + "HeaderNewAccount": "નવું એકાઉન્ટ", + "HeaderNewLibrary": "નવી પુસ્તકાલય", + "HeaderNotifications": "સૂચનાઓ", + "HeaderOpenRSSFeed": "RSS ફીડ ખોલો", + "HeaderOtherFiles": "અન્ય ફાઇલો", + "HeaderPermissions": "પરવાનગીઓ", + "HeaderPlayerQueue": "પ્લેયર કતાર", + "HeaderPlaylist": "પ્લેલિસ્ટ", + "HeaderPlaylistItems": "પ્લેલિસ્ટ ની વસ્તુઓ", + "HeaderPodcastsToAdd": "ઉમેરવા માટે પોડકાસ્ટ્સ", + "HeaderPreviewCover": "પૂર્વાવલોકન કવર", + "HeaderRemoveEpisode": "એપિસોડ કાઢી નાખો", + "HeaderRemoveEpisodes": "{0} એપિસોડ્સ કાઢી નાખો", + "HeaderRSSFeedGeneral": "સામાન્ય RSS ફીડ", + "HeaderRSSFeedIsOpen": "RSS ફીડ ખોલેલી છે", + "HeaderRSSFeeds": "RSS ફીડ્સ", + "HeaderSavedMediaProgress": "સાચવેલ મીડિયા પ્રગતિ", + "HeaderSchedule": "સમયપત્રક", + "HeaderScheduleLibraryScans": "પુસ્તકાલય સ્કેન સમયપત્રક", + "HeaderSession": "સેશન", + "HeaderSetBackupSchedule": "બેકઅપ સમયપત્રક સેટ કરો", "HeaderStatsLongestItems": "Longest Items (hrs)", "HeaderStatsMinutesListeningChart": "Minutes Listening (last 7 days)", "HeaderStatsRecentSessions": "Recent Sessions", From 23fa9e8d7f88495bd2c16f7b303649bc71a45dd3 Mon Sep 17 00:00:00 2001 From: Dr-Blank <64108942+Dr-Blank@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:15:18 -0500 Subject: [PATCH 02/19] Update gu.json --- client/strings/gu.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/strings/gu.json b/client/strings/gu.json index 9a105722..3504916e 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -149,9 +149,15 @@ "HeaderScheduleLibraryScans": "પુસ્તકાલય સ્કેન સમયપત્રક", "HeaderSession": "સેશન", "HeaderSetBackupSchedule": "બેકઅપ સમયપત્રક સેટ કરો", - "HeaderStatsLongestItems": "Longest Items (hrs)", - "HeaderStatsMinutesListeningChart": "Minutes Listening (last 7 days)", - "HeaderStatsRecentSessions": "Recent Sessions", + "HeaderSettings": "સેટિંગ્સ", + "HeaderSettingsDisplay": "ડિસ્પ્લે સેટિંગ્સ", + "HeaderSettingsExperimental": "પ્રયોગશીલ સેટિંગ્સ", + "HeaderSettingsGeneral": "સામાન્ય સેટિંગ્સ", + "HeaderSettingsScanner": "સ્કેનર સેટિંગ્સ", + "HeaderSleepTimer": "સ્લીપ ટાઈમર", + "HeaderStatsLargestItems": "સૌથી મોટી વસ્તુઓ", + "HeaderStatsLongestItems": "સૌથી લાંબી વસ્તુઓ (કલાક)", + "HeaderStatsMinutesListeningChart": "સાંભળવાની મિનિટ (છેલ્લા ૭ દિવસ)", "HeaderStatsTop10Authors": "Top 10 Authors", "HeaderStatsTop5Genres": "Top 5 Genres", "HeaderTableOfContents": "Table of Contents", From 6d968f90448ba99b39629b12295a53267b229780 Mon Sep 17 00:00:00 2001 From: Dr-Blank <64108942+Dr-Blank@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:16:03 -0500 Subject: [PATCH 03/19] Update gu.json --- client/strings/gu.json | 1 + 1 file changed, 1 insertion(+) diff --git a/client/strings/gu.json b/client/strings/gu.json index 3504916e..ae57c7a2 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -158,6 +158,7 @@ "HeaderStatsLargestItems": "સૌથી મોટી વસ્તુઓ", "HeaderStatsLongestItems": "સૌથી લાંબી વસ્તુઓ (કલાક)", "HeaderStatsMinutesListeningChart": "સાંભળવાની મિનિટ (છેલ્લા ૭ દિવસ)", + "HeaderStatsRecentSessions": "છેલ્લી સાંભળતી સેશન્સ", "HeaderStatsTop10Authors": "Top 10 Authors", "HeaderStatsTop5Genres": "Top 5 Genres", "HeaderTableOfContents": "Table of Contents", From 3cc900ffbfc3c3c6d2f08e64a717e73c62c2d82b Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Mon, 20 Nov 2023 08:51:00 -0800 Subject: [PATCH 04/19] Adds fetching book data on upload --- client/components/cards/ItemUploadCard.vue | 54 +++++++++++++-- client/pages/upload/index.vue | 81 ++++++++++++++++++---- client/strings/en-us.json | 4 +- 3 files changed, 119 insertions(+), 20 deletions(-) diff --git a/client/components/cards/ItemUploadCard.vue b/client/components/cards/ItemUploadCard.vue index 21d97b20..68b77d56 100644 --- a/client/components/cards/ItemUploadCard.vue +++ b/client/components/cards/ItemUploadCard.vue @@ -8,6 +8,12 @@ close +
+ refresh +
+ @@ -61,10 +67,11 @@ export default { props: { item: { type: Object, - default: () => {} + default: () => { } }, mediaType: String, - processing: Boolean + processing: Boolean, + provider: String }, data() { return { @@ -76,7 +83,8 @@ export default { error: '', isUploading: false, uploadFailed: false, - uploadSuccess: false + uploadSuccess: false, + isFetchingMetadata: false } }, computed: { @@ -94,6 +102,16 @@ export default { } else { return this.itemData.title } + }, + isNonInteractable() { + return this.isUploading || this.isFetchingMetadata + }, + nonInteractionLabel() { + if (this.isUploading) { + return this.$strings.MessageUploading + } else if (this.isFetchingMetadata) { + return this.$strings.LabelFetchingMetadata + } } }, methods: { @@ -105,6 +123,30 @@ export default { titleUpdated() { this.error = '' }, + async fetchMetadata() { + if (!this.itemData.title.trim().length) { + return + } + + this.isFetchingMetadata = true + + try { + const searchQueryString = `title=${this.itemData.title}&author=${this.itemData.author}&provider=${this.provider}` + const [bestCandidate, ..._rest] = await this.$axios.$get(`/api/search/books?${searchQueryString}`) + + this.itemData = { + ...this.itemData, + title: bestCandidate?.title, + author: bestCandidate?.author, + series: (bestCandidate?.series || [])[0]?.series + } + } catch (e) { + console.error('Failed', e) + // TODO: do something with the error? + } finally { + this.isFetchingMetadata = false + } + }, getData() { if (!this.itemData.title) { this.error = 'Must have a title' @@ -128,4 +170,4 @@ export default { } } } - \ No newline at end of file + diff --git a/client/pages/upload/index.vue b/client/pages/upload/index.vue index 09a9008b..bf3cf584 100644 --- a/client/pages/upload/index.vue +++ b/client/pages/upload/index.vue @@ -14,6 +14,14 @@ +
+ +

{{ $strings.LabelAutoFetchMetadata }}

+
+ +
+
+

{{ error }}

@@ -61,9 +69,16 @@ - +
@@ -92,13 +107,18 @@ export default { selectedLibraryId: null, selectedFolderId: null, processing: false, - uploadFinished: false + uploadFinished: false, + fetchMetadata: { + enabled: false, + provider: 'google' + } } }, watch: { selectedLibrary(newVal) { if (newVal && !this.selectedFolderId) { this.setDefaultFolder() + this.setMetadataProvider() } } }, @@ -133,6 +153,13 @@ export default { selectedLibraryIsPodcast() { return this.selectedLibraryMediaType === 'podcast' }, + providers() { + if (this.selectedLibraryIsPodcast) return this.$store.state.scanners.podcastProviders + return this.$store.state.scanners.providers + }, + canFetchMetadata() { + return !this.selectedLibraryIsPodcast && this.fetchMetadata.enabled + }, selectedFolder() { if (!this.selectedLibrary) return null return this.selectedLibrary.folders.find((fold) => fold.id === this.selectedFolderId) @@ -160,12 +187,16 @@ export default { } } this.setDefaultFolder() + this.setMetadataProvider() }, setDefaultFolder() { if (!this.selectedFolderId && this.selectedLibrary && this.selectedLibrary.folders.length) { this.selectedFolderId = this.selectedLibrary.folders[0].id } }, + setMetadataProvider() { + this.fetchMetadata.provider = this.$store.getters['libraries/getLibraryProvider'](this.selectedLibraryId) + }, removeItem(item) { this.items = this.items.filter((b) => b.index !== item.index) if (!this.items.length) { @@ -213,27 +244,49 @@ export default { var items = e.dataTransfer.items || [] var itemResults = await this.uploadHelpers.getItemsFromDrop(items, this.selectedLibraryMediaType) - this.setResults(itemResults) + this.onItemsSelected(itemResults) }, inputChanged(e) { if (!e.target || !e.target.files) return var _files = Array.from(e.target.files) if (_files && _files.length) { var itemResults = this.uploadHelpers.getItemsFromPicker(_files, this.selectedLibraryMediaType) - this.setResults(itemResults) + this.onItemsSelected(itemResults) } }, - setResults(itemResults) { + onItemsSelected(itemResults) { + if (this.itemSelectionSuccessful(itemResults)) { + // setTimeout ensures the new item ref is attached before this method is called + setTimeout(this.attemptMetadataFetch, 0) + } + }, + itemSelectionSuccessful(itemResults) { + console.log('Upload results', itemResults) + if (itemResults.error) { this.error = itemResults.error this.items = [] this.ignoredFiles = [] - } else { - this.error = '' - this.items = itemResults.items - this.ignoredFiles = itemResults.ignoredFiles + return false } - console.log('Upload results', itemResults) + + this.error = '' + this.items = itemResults.items + this.ignoredFiles = itemResults.ignoredFiles + return true + }, + attemptMetadataFetch() { + if (!this.canFetchMetadata) { + return false + } + + this.items.forEach((item) => { + let itemRef = this.$refs[`itemCard-${item.index}`] + + if (itemRef?.length) { + itemRef[0].fetchMetadata(this.fetchMetadata.provider) + } + }) }, updateItemCardStatus(index, status) { var ref = this.$refs[`itemCard-${index}`] @@ -346,6 +399,8 @@ export default { }, mounted() { this.selectedLibraryId = this.$store.state.libraries.currentLibraryId + this.setMetadataProvider() + this.setDefaultFolder() window.addEventListener('dragenter', this.dragenter) window.addEventListener('dragleave', this.dragleave) @@ -359,4 +414,4 @@ export default { window.removeEventListener('drop', this.drop) } } - \ No newline at end of file + diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 6f06ca77..9c608e48 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -194,6 +194,7 @@ "LabelAuthorLastFirst": "Author (Last, First)", "LabelAuthors": "Authors", "LabelAutoDownloadEpisodes": "Auto Download Episodes", + "LabelAutoFetchMetadata": "Auto Fetch Metadata", "LabelBackToUser": "Back to User", "LabelBackupLocation": "Backup Location", "LabelBackupsEnableAutomaticBackups": "Enable automatic backups", @@ -259,6 +260,7 @@ "LabelExample": "Example", "LabelExplicit": "Explicit", "LabelFeedURL": "Feed URL", + "LabelFetchingMetadata": "Fetching Metadata", "LabelFile": "File", "LabelFileBirthtime": "File Birthtime", "LabelFileModified": "File Modified", @@ -727,4 +729,4 @@ "ToastSocketFailedToConnect": "Socket failed to connect", "ToastUserDeleteFailed": "Failed to delete user", "ToastUserDeleteSuccess": "User deleted" -} \ No newline at end of file +} From 8c434703fb5b24afde800cd00de62bb235f9090b Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Mon, 20 Nov 2023 09:18:50 -0800 Subject: [PATCH 05/19] Added computed metadata check to UI dropdown --- client/pages/upload/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/pages/upload/index.vue b/client/pages/upload/index.vue index bf3cf584..8dd13990 100644 --- a/client/pages/upload/index.vue +++ b/client/pages/upload/index.vue @@ -18,7 +18,7 @@

{{ $strings.LabelAutoFetchMetadata }}

- +
From e5579b2c3346c816856e7a9f47740661c6c66699 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Tue, 28 Nov 2023 11:45:44 -0800 Subject: [PATCH 06/19] Improved UI; Added tooltips; Fixed unrelated layout issues --- client/components/cards/ItemUploadCard.vue | 27 ++++++++++++---------- client/pages/upload/index.vue | 16 +++++++++---- client/strings/en-us.json | 2 ++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/client/components/cards/ItemUploadCard.vue b/client/components/cards/ItemUploadCard.vue index 68b77d56..a393a170 100644 --- a/client/components/cards/ItemUploadCard.vue +++ b/client/components/cards/ItemUploadCard.vue @@ -8,12 +8,6 @@ close -
- refresh -
-