From 7a5fbf38c02530cd520b26d2fc308f75b21e6c09 Mon Sep 17 00:00:00 2001 From: Tommy Mikkelsen Date: Sun, 27 Nov 2022 15:18:24 +0100 Subject: [PATCH] #507 WIP MaxErrors --- public/locales/en.json | 5 +- src/background.js | 6 +- src/components/modules/Download/Download.vue | 11 ++- .../modules/Download/Queue/Queue.vue | 48 +++++++--- .../modules/Download/Settings/settings.vue | 25 +++++ .../modules/Download/scripts/Download.js | 92 ++++++++++++++++--- src/store/modules/downloadQueue.js | 9 +- 7 files changed, 158 insertions(+), 38 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index 66ea2be..93f45f0 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -594,8 +594,9 @@ "Description": "Here you can define the settings for @:Modules.Download.Name", "Return": "Return to @:Modules.Download.Name", "DownloadMaxBandWidth": "Maximum bandwidth to use", - "ttDownloadMaxBandWidth": "Here you select the maximum bandwith to use when downloading. Don't use maximum, unless you want to lose your friend. Also note, that maximum bandwidth can not exceed what the server owner has set" - + "DownloadMaxErrors": "Maximum errors allowed", + "ttDownloadMaxBandWidth": "Here you select the maximum bandwith to use when downloading. Don't use maximum, unless you want to lose your friend. Also note, that maximum bandwidth can not exceed what the server owner has set", + "ttDownloadMaxErrors": "Maximum errors allowed before showing a warning" } } } diff --git a/src/background.js b/src/background.js index 059fafc..705447f 100644 --- a/src/background.js +++ b/src/background.js @@ -194,6 +194,7 @@ ipcMain.on('downloadMedia', function (event, data) { maxrateLimit * 1024 * 1024 , // upload limit, maxrateLimit * 1024 * 1024 // download limit ], + timeout: 2, onDownloadProgress: progressEvent => { const downloadData = {}; downloadData['Downloaded'] = progressEvent.loaded; @@ -219,8 +220,11 @@ ipcMain.on('downloadMedia', function (event, data) { }) }).catch((error) => { log.error(`[background.js] (downloadFile) - ${error}`); + event.sender.send('downloadMediaError', error.message); + console.log('Ged 88-3', error.code) + console.log('Ged 88-3-1', error.message) + console.log('Ged 88-3-2', error.stack) targetStream.end(); - event.sender.send('downloadMediaError', error); }) }) diff --git a/src/components/modules/Download/Download.vue b/src/components/modules/Download/Download.vue index 5447f03..3e5cfc6 100644 --- a/src/components/modules/Download/Download.vue +++ b/src/components/modules/Download/Download.vue @@ -60,6 +60,7 @@ :data="tableData" :bordered="tableAttribute.bordered" :minWidth="tableAttribute.minWidth" + :height="tableAttribute.height" :language="tableAttribute.language"> @@ -130,14 +131,14 @@ { prop: 'mediaKey', isHidden: true }, { prop: 'Key', isHidden: true }, { prop: 'Title',searchable: true,sortable: true, width: 80 }, - { prop: 'Released',searchable: true,sortable: true, width: 30 }, - { prop: 'Added',searchable: true,sortable: true, width: 30 }, - { prop: 'Updated',searchable: true,sortable: true, width: 30 }, + { prop: 'Released',searchable: false,sortable: true, width: 30 }, + { prop: 'Added',searchable: false,sortable: true, width: 30 }, + { prop: 'Updated',searchable: false,sortable: true, width: 30 }, { prop: 'Type', isHidden: true } ], tableData: [], tableAttribute: { - height: 1000, + height: 250, itemHeight: 42, minWidth: 10, selectable: true, @@ -297,7 +298,7 @@ this.isLoading = true; await this.getMediaInfo(myarg['Key']); this.selMediaTitle = myarg['Title']; - this.mediaInfoTitle = `${i18n.t("Modules.Download.mediaInfo.mediaInfoTitle")} - ${myarg['Title']}` + this.mediaInfoTitle = `${i18n.t("Modules.Download.mediaInfo.title")} - ${myarg['Title']}` // Stop Spinner this.isLoading = false; this.$refs['MediaInfo'].show(); diff --git a/src/components/modules/Download/Queue/Queue.vue b/src/components/modules/Download/Queue/Queue.vue index f97b149..03b9f3b 100644 --- a/src/components/modules/Download/Queue/Queue.vue +++ b/src/components/modules/Download/Queue/Queue.vue @@ -17,7 +17,7 @@ :selectable="tableAttribute.selectable" :itemHeight="tableAttribute.itemHeight">