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
This commit is contained in:
ISO-B 2024-09-08 00:06:55 +03:00
parent 34dcdc89c3
commit 62e3ca4068
2 changed files with 6 additions and 0 deletions

View file

@ -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)])

View file

@ -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",