Fixed: Address issues with the status being wrong color on the index and movie details (not tracking anything queued/downloading)
Fixed: Updated fetchQueueDetails() to not pass movie ids since the store doesn't use them anyways New: Added text to index poster progress bar showing status #4525 #4526 #4982pull/4986/head
parent
a2e8d1d5d6
commit
c51b08e26c
@ -0,0 +1,61 @@
|
||||
import titleCase from 'Utilities/String/titleCase';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
export default function getQueueStatusText(queueStatus, queueState) {
|
||||
if (!queueStatus) {
|
||||
return;
|
||||
}
|
||||
|
||||
let statusLong = translate('Downloading');
|
||||
let statusShort = translate('Downloading');
|
||||
|
||||
switch (true) {
|
||||
case queueStatus !== 'completed':
|
||||
switch (queueStatus) {
|
||||
case 'queue':
|
||||
case 'paused':
|
||||
case 'failed':
|
||||
statusLong = `${translate('Downloading')}: ${translate(titleCase(queueStatus))}`;
|
||||
statusShort = titleCase(queueStatus);
|
||||
break;
|
||||
case 'delay':
|
||||
statusLong = `${translate('Downloading')}: ${translate('Pending')}`;
|
||||
statusShort = translate('Pending');
|
||||
break;
|
||||
case 'DownloadClientUnavailable':
|
||||
case 'warning':
|
||||
statusLong = `${translate('Downloading')}: ${translate('Error')}`;
|
||||
statusShort = translate('Error');
|
||||
break;
|
||||
case 'downloading':
|
||||
statusLong = titleCase(queueStatus);
|
||||
statusShort = titleCase(queueStatus);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
|
||||
case queueStatus === 'completed':
|
||||
switch (queueState) {
|
||||
case 'importPending':
|
||||
statusLong = `${translate('Downloaded')}: ${translate('Pending')}`;
|
||||
statusShort = translate('Downloaded');
|
||||
break;
|
||||
case 'importing':
|
||||
statusLong = `${translate('Downloaded')}: ${translate('Importing')}`;
|
||||
statusShort = translate('Downloaded');
|
||||
break;
|
||||
case 'failedPending':
|
||||
statusLong = `${translate('Downloaded')}: ${translate('Waiting')}`;
|
||||
statusShort = translate('Downloaded');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
const result = { longText: statusLong, shortText: statusShort };
|
||||
return result;
|
||||
}
|
Loading…
Reference in new issue