From 6c708a7a3e2aecea458a4fabe78eafbf68997574 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 4 Jun 2022 15:14:34 -0500 Subject: [PATCH] Calendar item/episode status fixes Fixes #1425 --- frontend/src/Activity/Queue/QueueDetails.js | 38 +++++++++++++++++-- frontend/src/Album/EpisodeStatus.js | 2 +- .../Events/CalendarEventQueueDetails.js | 8 +++- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/frontend/src/Activity/Queue/QueueDetails.js b/frontend/src/Activity/Queue/QueueDetails.js index 473da308b..9aa720bd7 100644 --- a/frontend/src/Activity/Queue/QueueDetails.js +++ b/frontend/src/Activity/Queue/QueueDetails.js @@ -11,13 +11,13 @@ function QueueDetails(props) { size, sizeleft, estimatedCompletionTime, - status: queueStatus, + status, + trackedDownloadState, + trackedDownloadStatus, errorMessage, progressBar } = props; - const status = queueStatus.toLowerCase(); - const progress = (100 - sizeleft / size * 100); if (status === 'pending') { @@ -40,7 +40,35 @@ function QueueDetails(props) { ); } - // TODO: show an icon when download is complete, but not imported yet? + if (trackedDownloadStatus === 'warning') { + return ( + + ); + } + + if (trackedDownloadState === 'importPending') { + return ( + + ); + } + + if (trackedDownloadState === 'importing') { + return ( + + ); + } } if (errorMessage) { @@ -91,6 +119,8 @@ QueueDetails.propTypes = { sizeleft: PropTypes.number.isRequired, estimatedCompletionTime: PropTypes.string, status: PropTypes.string.isRequired, + trackedDownloadState: PropTypes.string.isRequired, + trackedDownloadStatus: PropTypes.string.isRequired, errorMessage: PropTypes.string, progressBar: PropTypes.node.isRequired }; diff --git a/frontend/src/Album/EpisodeStatus.js b/frontend/src/Album/EpisodeStatus.js index b8e73f49a..fc976103b 100644 --- a/frontend/src/Album/EpisodeStatus.js +++ b/frontend/src/Album/EpisodeStatus.js @@ -28,7 +28,7 @@ function EpisodeStatus(props) { size } = queueItem; - const progress = (100 - sizeleft / size * 100); + const progress = size ? (100 - sizeleft / size * 100) : 0; return (
diff --git a/frontend/src/Calendar/Events/CalendarEventQueueDetails.js b/frontend/src/Calendar/Events/CalendarEventQueueDetails.js index 2ee95cfb4..6e65c4e1a 100644 --- a/frontend/src/Calendar/Events/CalendarEventQueueDetails.js +++ b/frontend/src/Calendar/Events/CalendarEventQueueDetails.js @@ -12,10 +12,12 @@ function CalendarEventQueueDetails(props) { sizeleft, estimatedCompletionTime, status, + trackedDownloadState, + trackedDownloadStatus, errorMessage } = props; - const progress = (100 - sizeleft / size * 100); + const progress = size ? (100 - sizeleft / size * 100) : 0; return ( @@ -45,6 +49,8 @@ CalendarEventQueueDetails.propTypes = { sizeleft: PropTypes.number.isRequired, estimatedCompletionTime: PropTypes.string, status: PropTypes.string.isRequired, + trackedDownloadState: PropTypes.string.isRequired, + trackedDownloadStatus: PropTypes.string.isRequired, errorMessage: PropTypes.string };