Added retry function for failed downloads

This commit is contained in:
RemixDev 2022-08-19 23:43:22 +02:00
parent cef3e3d8d4
commit 399b6a9c82
2 changed files with 7 additions and 2 deletions

View File

@ -173,7 +173,7 @@ export default {
onResultIconClick() { onResultIconClick() {
if (this.isDeterminateStatus) { if (this.isDeterminateStatus) {
if (this.finishedWithFails) { if (this.finishedWithFails) {
this.$emit('show-errors', this.queueItem) this.$emit('retry-download', this.queueItem.uuid)
} }
if (this.queueItem.status === 'downloading') { if (this.queueItem.status === 'downloading') {

View File

@ -59,6 +59,7 @@
:show-tags="showTags" :show-tags="showTags"
@show-errors="showErrorsTab" @show-errors="showErrorsTab"
@remove-item="onRemoveItem" @remove-item="onRemoveItem"
@retry-download="onRetryDownload"
/> />
</div> </div>
</section> </section>
@ -70,7 +71,7 @@ import QueueItem from '@components/downloads/QueueItem.vue'
import { socket } from '@/utils/socket' import { socket } from '@/utils/socket'
import { toast } from '@/utils/toasts' import { toast } from '@/utils/toasts'
import { fetchData } from '@/utils/api' import { fetchData, postToServer } from '@/utils/api'
const tabMinWidth = 250 const tabMinWidth = 250
const tabMaxWidth = 500 const tabMaxWidth = 500
@ -153,6 +154,10 @@ export default {
onRemoveItem(uuid) { onRemoveItem(uuid) {
socket.emit('removeFromQueue', uuid) socket.emit('removeFromQueue', uuid)
}, },
onRetryDownload(uuid) {
console.log("Retry", uuid)
postToServer('retryDownload', {uuid})
},
setTabWidth(newWidth) { setTabWidth(newWidth) {
if (undefined === newWidth) { if (undefined === newWidth) {
this.$refs.container.style.width = '' this.$refs.container.style.width = ''