diff --git a/Lantean.QBTMud/Components/Options/DownloadsOptions.razor b/Lantean.QBTMud/Components/Options/DownloadsOptions.razor index 52ff348..044d18c 100644 --- a/Lantean.QBTMud/Components/Options/DownloadsOptions.razor +++ b/Lantean.QBTMud/Components/Options/DownloadsOptions.razor @@ -62,7 +62,7 @@ - + Manual Automatic diff --git a/Lantean.QBTMud/Helpers/DisplayHelpers.cs b/Lantean.QBTMud/Helpers/DisplayHelpers.cs index 19d1753..dae2f82 100644 --- a/Lantean.QBTMud/Helpers/DisplayHelpers.cs +++ b/Lantean.QBTMud/Helpers/DisplayHelpers.cs @@ -25,7 +25,7 @@ namespace Lantean.QBTMud.Helpers const long InfiniteEtaSentinelSeconds = 8_640_000; // ~100 days, used by qBittorrent for "infinite" ETA. var value = seconds.Value; - if (value >= long.MaxValue || value >= (long)TimeSpan.MaxValue.TotalSeconds || value == InfiniteEtaSentinelSeconds) + if (value >= long.MaxValue || value >= TimeSpan.MaxValue.TotalSeconds || value == InfiniteEtaSentinelSeconds) { return "∞"; } @@ -419,4 +419,4 @@ namespace Lantean.QBTMud.Helpers }; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Helpers/FilterHelper.cs b/Lantean.QBTMud/Helpers/FilterHelper.cs index c5ab51e..993d92e 100644 --- a/Lantean.QBTMud/Helpers/FilterHelper.cs +++ b/Lantean.QBTMud/Helpers/FilterHelper.cs @@ -207,7 +207,7 @@ namespace Lantean.QBTMud.Helpers break; case Status.Paused: - if (!state.Contains("paused") || !state.Contains("stopped")) + if (!state.Contains("paused") && !state.Contains("stopped")) { return false; } @@ -284,4 +284,4 @@ namespace Lantean.QBTMud.Helpers }; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Services/DataManager.cs b/Lantean.QBTMud/Services/DataManager.cs index 3552331..5c3a9ee 100644 --- a/Lantean.QBTMud/Services/DataManager.cs +++ b/Lantean.QBTMud/Services/DataManager.cs @@ -220,12 +220,11 @@ namespace Lantean.QBTMud.Services } torrentList.Tags.Add(normalizedTag); - if (!torrentList.TagState.ContainsKey(normalizedTag)) - { - torrentList.TagState[normalizedTag] = torrentList.Torrents.Values - .Where(t => FilterHelper.FilterTag(t, normalizedTag)) - .ToHashesHashSet(); - } + var matchingHashes = torrentList.Torrents + .Where(pair => FilterHelper.FilterTag(pair.Value, normalizedTag)) + .Select(pair => pair.Key) + .ToHashSet(); + torrentList.TagState[normalizedTag] = matchingHashes; } } @@ -1226,4 +1225,4 @@ namespace Lantean.QBTMud.Services return new RssList(feeds, articles); } } -} +} \ No newline at end of file