From 62e3ca406842ffd5b56a9ce266e14fc972d9574f Mon Sep 17 00:00:00 2001 From: ISO-B <3048685+ISO-B@users.noreply.github.com> Date: Sun, 8 Sep 2024 00:06:55 +0300 Subject: [PATCH] Polished download series function - File and size resets every time when download is triggered - If everything is downloaded show popup to tell it to user --- pages/bookshelf/series/_id.vue | 5 +++++ strings/en-us.json | 1 + 2 files changed, 6 insertions(+) diff --git a/pages/bookshelf/series/_id.vue b/pages/bookshelf/series/_id.vue index b188afe0..3943b885 100644 --- a/pages/bookshelf/series/_id.vue +++ b/pages/bookshelf/series/_id.vue @@ -126,6 +126,8 @@ export default { // Fetch series data from server let page = 0 let fetchFinished = false + this.missingFiles = 0 + this.missingFilesSize = 0 while (fetchFinished === false) { fetchFinished = await this.fetchSeriesEntities(page) page += 1 @@ -134,6 +136,9 @@ export default { console.error('failed to fetch series books data') return null } + if (this.missingFiles == 0) { + alert(this.$getString('MessageSeriesAlreadyDownloaded')) + } // Format message for dialog let startDownloadMessage = this.$getString('MessageSeriesDownloadConfirmIos', [this.libraryIds.length, this.missingFiles, this.$bytesPretty(this.missingFilesSize)]) diff --git a/strings/en-us.json b/strings/en-us.json index 2d89987e..c7ca1966 100644 --- a/strings/en-us.json +++ b/strings/en-us.json @@ -287,6 +287,7 @@ "MessageNoUpdatesWereNecessary": "No updates were necessary", "MessageNoUserPlaylists": "You have no playlists", "MessageReportBugsAndContribute": "Report bugs, request features, and contribute on", + "MessageSeriesAlreadyDownloaded": "You have already downloaded all books in this series.", "MessageSeriesDownloadConfirm": "Download missing {0} book(s) with {1} file(s), totaling {2} to folder {3}?", "MessageSeriesDownloadConfirmIos": "Download missing {0} book(s) with {1} file(s), totaling {2}?", "MessageSocketConnectedOverMeteredCellular": "Socket connected over metered cellular",