diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.tsx b/frontend/src/Series/Index/Table/SeriesIndexRow.tsx
index fae5ba364..380ee46b4 100644
--- a/frontend/src/Series/Index/Table/SeriesIndexRow.tsx
+++ b/frontend/src/Series/Index/Table/SeriesIndexRow.tsx
@@ -24,6 +24,7 @@ import { executeCommand } from 'Store/Actions/commandActions';
import formatBytes from 'Utilities/Number/formatBytes';
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
import titleCase from 'Utilities/String/titleCase';
+import SeriesIndexProgressBar from '../ProgressBar/SeriesIndexProgressBar';
import hasGrowableColumns from './hasGrowableColumns';
import SeasonsCell from './SeasonsCell';
import selectTableOptions from './selectTableOptions';
@@ -306,19 +307,18 @@ function SeriesIndexRow(props: SeriesIndexRowProps) {
}
if (name === 'episodeProgress') {
- const progress = episodeCount
- ? (episodeFileCount / episodeCount) * 100
- : 100;
-
return (
-
);
@@ -330,21 +330,20 @@ function SeriesIndexRow(props: SeriesIndexRowProps) {
}
const seasonStatistics = latestSeason.statistics || {};
- const progress = seasonStatistics.episodeCount
- ? (seasonStatistics.episodeFileCount /
- seasonStatistics.episodeCount) *
- 100
- : 100;
return (
-
);
diff --git a/frontend/src/Series/Index/createSeriesQueueDetailsSelector.ts b/frontend/src/Series/Index/createSeriesQueueDetailsSelector.ts
new file mode 100644
index 000000000..23905e7b2
--- /dev/null
+++ b/frontend/src/Series/Index/createSeriesQueueDetailsSelector.ts
@@ -0,0 +1,42 @@
+import { createSelector } from 'reselect';
+
+export interface SeriesQueueDetails {
+ count: number;
+ episodesWithFiles: number;
+}
+
+function createSeriesQueueDetailsSelector(
+ seriesId: number,
+ seasonNumber?: number
+) {
+ return createSelector(
+ (state) => state.queue.details.items,
+ (queueItems) => {
+ return queueItems.reduce(
+ (acc: SeriesQueueDetails, item) => {
+ if (item.seriesId !== seriesId) {
+ return acc;
+ }
+
+ if (seasonNumber != null && item.seasonNumber !== seasonNumber) {
+ return acc;
+ }
+
+ acc.count++;
+
+ if (item.episodeHasFile) {
+ acc.episodesWithFiles++;
+ }
+
+ return acc;
+ },
+ {
+ count: 0,
+ episodesWithFiles: 0,
+ }
+ );
+ }
+ );
+}
+
+export default createSeriesQueueDetailsSelector;
diff --git a/frontend/src/Utilities/Series/getProgressBarKind.js b/frontend/src/Utilities/Series/getProgressBarKind.ts
similarity index 58%
rename from frontend/src/Utilities/Series/getProgressBarKind.js
rename to frontend/src/Utilities/Series/getProgressBarKind.ts
index eb3b2dd6e..f45387024 100644
--- a/frontend/src/Utilities/Series/getProgressBarKind.js
+++ b/frontend/src/Utilities/Series/getProgressBarKind.ts
@@ -1,6 +1,15 @@
import { kinds } from 'Helpers/Props';
-function getProgressBarKind(status, monitored, progress) {
+function getProgressBarKind(
+ status: string,
+ monitored: boolean,
+ progress: number,
+ isDownloading: boolean
+) {
+ if (isDownloading) {
+ return kinds.PURPLE;
+ }
+
if (progress === 100) {
return status === 'ended' ? kinds.SUCCESS : kinds.PRIMARY;
}
diff --git a/src/Sonarr.Api.V3/Queue/QueueResource.cs b/src/Sonarr.Api.V3/Queue/QueueResource.cs
index 2d426f091..dd286960f 100644
--- a/src/Sonarr.Api.V3/Queue/QueueResource.cs
+++ b/src/Sonarr.Api.V3/Queue/QueueResource.cs
@@ -17,6 +17,7 @@ namespace Sonarr.Api.V3.Queue
{
public int? SeriesId { get; set; }
public int? EpisodeId { get; set; }
+ public int? SeasonNumber { get; set; }
public SeriesResource Series { get; set; }
public EpisodeResource Episode { get; set; }
public List
Languages { get; set; }
@@ -37,6 +38,7 @@ namespace Sonarr.Api.V3.Queue
public string DownloadClient { get; set; }
public string Indexer { get; set; }
public string OutputPath { get; set; }
+ public bool EpisodeHasFile { get; set; }
}
public static class QueueResourceMapper
@@ -53,6 +55,7 @@ namespace Sonarr.Api.V3.Queue
Id = model.Id,
SeriesId = model.Series?.Id,
EpisodeId = model.Episode?.Id,
+ SeasonNumber = model.Episode?.SeasonNumber,
Series = includeSeries && model.Series != null ? model.Series.ToResource() : null,
Episode = includeEpisode && model.Episode != null ? model.Episode.ToResource() : null,
Languages = model.Languages,
@@ -72,7 +75,8 @@ namespace Sonarr.Api.V3.Queue
Protocol = model.Protocol,
DownloadClient = model.DownloadClient,
Indexer = model.Indexer,
- OutputPath = model.OutputPath
+ OutputPath = model.OutputPath,
+ EpisodeHasFile = model.Episode?.HasFile ?? false
};
}