Skip to content

Commit 93b199a

Browse files
committed
fixup! displaying progress
1 parent 7070555 commit 93b199a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

SubTubular/SearchProgress.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ public sealed class VideoList
1919

2020
public override string ToString()
2121
{
22-
var videos = Videos?.Where(v => v.Value != State).GroupBy(v => v.Value).Select(g => $"{g.Key} " + g.Count()).Join(" - ");
23-
return $"{State} {CompletedJobs}/{AllJobs}" + (videos.IsNullOrEmpty() ? null : (" - " + videos));
22+
var videos = Videos?.Where(v => v.Value != State).GroupBy(v => v.Value).Select(g => $"{Display(g.Key)} " + g.Count()).Join(" | ");
23+
return $"{Display(State)} {CompletedJobs}/{AllJobs}" + (videos.IsNullOrEmpty() ? null : (" - " + videos));
2424
}
2525
}
2626

27-
public enum Status
27+
private static string Display(Status status) => status switch
2828
{
29-
queued, loading, downloading, validated, indexing, searching, indexingAndSearching, searched
30-
}
29+
Status.indexingAndSearching => "indexing and searching",
30+
_ => status.ToString()
31+
};
32+
33+
public enum Status { queued, loading, downloading, validated, indexing, searching, indexingAndSearching, searched }
3134
}
3235

3336
internal class BatchProgressReporter(IProgress<BatchProgress> reporter, BatchProgress batchProgress)

0 commit comments

Comments
 (0)