10 feat download queue (#59)
* testing message queue * better mq syncronisation * major code refactoring, concern separation. * bugfix * code refactoring * queuesize configurable via flags * code refactoring * comments * code refactoring, updated readme
This commit is contained in:
@@ -30,6 +30,7 @@ export function DownloadsCardView({ downloads, onStop }: Props) {
|
||||
resolution={download.info.resolution ?? ''}
|
||||
speed={download.progress.speed}
|
||||
size={download.info.filesize_approx ?? 0}
|
||||
status={download.progress.process_status}
|
||||
/>
|
||||
</Fragment>
|
||||
</Grid>
|
||||
|
||||
@@ -55,7 +55,11 @@ export function DownloadsListView({ downloads, onStop }: Props) {
|
||||
download.progress.percentage === '-1' ? 100 :
|
||||
Number(download.progress.percentage.replace('%', ''))
|
||||
}
|
||||
variant="determinate"
|
||||
variant={
|
||||
download.progress.process_status === 0
|
||||
? 'indeterminate'
|
||||
: 'determinate'
|
||||
}
|
||||
color={download.progress.percentage === '-1' ? 'success' : 'primary'}
|
||||
/>
|
||||
</TableCell>
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
Typography
|
||||
} from '@mui/material'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { ellipsis, formatSpeedMiB, roundMiB } from '../utils'
|
||||
import { ellipsis, formatSpeedMiB, mapProcessStatus, roundMiB } from '../utils'
|
||||
|
||||
type Props = {
|
||||
title: string
|
||||
@@ -23,6 +23,7 @@ type Props = {
|
||||
percentage: string
|
||||
size: number
|
||||
speed: number
|
||||
status: number
|
||||
onStop: () => void
|
||||
onCopy: () => void
|
||||
}
|
||||
@@ -35,6 +36,7 @@ export function StackableResult({
|
||||
percentage,
|
||||
speed,
|
||||
size,
|
||||
status,
|
||||
onStop,
|
||||
onCopy,
|
||||
}: Props) {
|
||||
@@ -80,7 +82,7 @@ export function StackableResult({
|
||||
}
|
||||
<Stack direction="row" spacing={1} py={2}>
|
||||
<Chip
|
||||
label={isCompleted ? 'Completed' : 'Downloading'}
|
||||
label={isCompleted ? 'Completed' : mapProcessStatus(status)}
|
||||
color="primary"
|
||||
size="small"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user