diff --git a/Lantean.QBTMudBlade/Components/Dialogs/AddTagDialog.razor.cs b/Lantean.QBTMudBlade/Components/Dialogs/AddTagDialog.razor.cs index 0cf549c..cfb7bb6 100644 --- a/Lantean.QBTMudBlade/Components/Dialogs/AddTagDialog.razor.cs +++ b/Lantean.QBTMudBlade/Components/Dialogs/AddTagDialog.razor.cs @@ -44,4 +44,4 @@ namespace Lantean.QBTMudBlade.Components.Dialogs MudDialog.Close(Tags); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/Dialogs/ManageCategoriesDialog.razor.cs b/Lantean.QBTMudBlade/Components/Dialogs/ManageCategoriesDialog.razor.cs index 1bcda66..a17aa47 100644 --- a/Lantean.QBTMudBlade/Components/Dialogs/ManageCategoriesDialog.razor.cs +++ b/Lantean.QBTMudBlade/Components/Dialogs/ManageCategoriesDialog.razor.cs @@ -19,7 +19,7 @@ namespace Lantean.QBTMudBlade.Components.Dialogs public IEnumerable Hashes { get; set; } = []; protected HashSet Categories { get; set; } = []; - + protected IList TorrentCategories { get; private set; } = []; protected override async Task OnInitializedAsync() diff --git a/Lantean.QBTMudBlade/Components/Dialogs/ManageTagsDialog.razor.cs b/Lantean.QBTMudBlade/Components/Dialogs/ManageTagsDialog.razor.cs index c14c103..ac1c2d3 100644 --- a/Lantean.QBTMudBlade/Components/Dialogs/ManageTagsDialog.razor.cs +++ b/Lantean.QBTMudBlade/Components/Dialogs/ManageTagsDialog.razor.cs @@ -1,7 +1,6 @@ using Lantean.QBitTorrentClient; using Microsoft.AspNetCore.Components; using MudBlazor; -using static MudBlazor.CategoryTypes; namespace Lantean.QBTMudBlade.Components.Dialogs { @@ -20,7 +19,7 @@ namespace Lantean.QBTMudBlade.Components.Dialogs public IEnumerable Hashes { get; set; } = []; protected HashSet Tags { get; set; } = []; - + protected IList> TorrentTags { get; private set; } = []; protected override async Task OnInitializedAsync() diff --git a/Lantean.QBTMudBlade/Components/DynamicTable.razor.cs b/Lantean.QBTMudBlade/Components/DynamicTable.razor.cs index 69fb463..9771d19 100644 --- a/Lantean.QBTMudBlade/Components/DynamicTable.razor.cs +++ b/Lantean.QBTMudBlade/Components/DynamicTable.razor.cs @@ -1,10 +1,6 @@ using Blazored.LocalStorage; -using Lantean.QBitTorrentClient.Models; -using Lantean.QBTMudBlade.Models; using Microsoft.AspNetCore.Components; using MudBlazor; -using System.Data.Common; -using static MudBlazor.CategoryTypes; namespace Lantean.QBTMudBlade.Components { @@ -237,7 +233,7 @@ namespace Lantean.QBTMudBlade.Components protected string RowStyleFuncInternal(T item, int index) { var style = "user-select: none; cursor: pointer;"; - //EqualityComparer.Default.Equals(item, SelectedItem) || + //EqualityComparer.Default.Equals(item, SelectedItem) || if (SelectedItems.Contains(item)) { style += " background-color: var(--mud-palette-grey-dark); color: var(--mud-palette-grey-light) !important;"; diff --git a/Lantean.QBTMudBlade/Components/ErrorDisplay.razor.cs b/Lantean.QBTMudBlade/Components/ErrorDisplay.razor.cs index 4ce057b..3c189b5 100644 --- a/Lantean.QBTMudBlade/Components/ErrorDisplay.razor.cs +++ b/Lantean.QBTMudBlade/Components/ErrorDisplay.razor.cs @@ -35,4 +35,4 @@ namespace Lantean.QBTMudBlade.Components await ErrorBoundary.RecoverAndClearErrors(); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/FakeNavLink.razor.cs b/Lantean.QBTMudBlade/Components/FakeNavLink.razor.cs index 9641806..8320489 100644 --- a/Lantean.QBTMudBlade/Components/FakeNavLink.razor.cs +++ b/Lantean.QBTMudBlade/Components/FakeNavLink.razor.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Routing; using Microsoft.AspNetCore.Components.Web; using MudBlazor; using MudBlazor.Utilities; @@ -32,7 +31,6 @@ namespace Lantean.QBTMudBlade.Components [Parameter] public Color IconColor { get; set; } = Color.Default; - [Parameter] public string? Target { get; set; } @@ -69,4 +67,4 @@ namespace Lantean.QBTMudBlade.Components await OnClick.InvokeAsync(ev); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/FilesTab.razor.cs b/Lantean.QBTMudBlade/Components/FilesTab.razor.cs index 713da0a..4214eb9 100644 --- a/Lantean.QBTMudBlade/Components/FilesTab.razor.cs +++ b/Lantean.QBTMudBlade/Components/FilesTab.razor.cs @@ -192,7 +192,7 @@ namespace Lantean.QBTMudBlade.Components { files = await ApiClient.GetTorrentContents(Hash); } - catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden || exception.StatusCode == HttpStatusCode.NotFound) { _timerCancellationToken.CancelIfNotDisposed(); return; @@ -332,7 +332,7 @@ namespace Lantean.QBTMudBlade.Components } return FileList!.Values.Where(f => f.Name.StartsWith(contentItem.Name + Extensions.DirectorySeparator) && !f.IsFolder); - } + } private IEnumerable GetChildren(ContentItem folder, int level) { diff --git a/Lantean.QBTMudBlade/Components/FiltersNav.razor.cs b/Lantean.QBTMudBlade/Components/FiltersNav.razor.cs index 1f2d1bc..903b20d 100644 --- a/Lantean.QBTMudBlade/Components/FiltersNav.razor.cs +++ b/Lantean.QBTMudBlade/Components/FiltersNav.razor.cs @@ -1,8 +1,6 @@ using Blazored.LocalStorage; using Lantean.QBTMudBlade.Models; using Microsoft.AspNetCore.Components; -using MudBlazor; -using static MudBlazor.Colors; namespace Lantean.QBTMudBlade.Components { @@ -68,14 +66,13 @@ namespace Lantean.QBTMudBlade.Components await CategoryChanged.InvokeAsync(category); } - var tag = await LocalStorage.GetItemAsStringAsync(_tagSelectionStorageKey); if (tag is not null) { Tag = tag; await TagChanged.InvokeAsync(tag); } - + var tracker = await LocalStorage.GetItemAsStringAsync(_trackerSelectionStorageKey); if (tracker is not null) { diff --git a/Lantean.QBTMudBlade/Components/GeneralTab.razor.cs b/Lantean.QBTMudBlade/Components/GeneralTab.razor.cs index ad867e5..25d99e0 100644 --- a/Lantean.QBTMudBlade/Components/GeneralTab.razor.cs +++ b/Lantean.QBTMudBlade/Components/GeneralTab.razor.cs @@ -70,7 +70,7 @@ namespace Lantean.QBTMudBlade.Components Pieces = await ApiClient.GetTorrentPieceStates(Hash); Properties = await ApiClient.GetTorrentProperties(Hash); } - catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden || exception.StatusCode == HttpStatusCode.NotFound) { _timerCancellationToken.CancelIfNotDisposed(); return; diff --git a/Lantean.QBTMudBlade/Components/Menu.razor.cs b/Lantean.QBTMudBlade/Components/Menu.razor.cs index 9eece45..78e3e85 100644 --- a/Lantean.QBTMudBlade/Components/Menu.razor.cs +++ b/Lantean.QBTMudBlade/Components/Menu.razor.cs @@ -1,7 +1,6 @@ using Lantean.QBitTorrentClient; using Lantean.QBitTorrentClient.Models; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; using MudBlazor; namespace Lantean.QBTMudBlade.Components diff --git a/Lantean.QBTMudBlade/Components/MudFieldSwitch.razor.cs b/Lantean.QBTMudBlade/Components/MudFieldSwitch.razor.cs index cad096c..3c82496 100644 --- a/Lantean.QBTMudBlade/Components/MudFieldSwitch.razor.cs +++ b/Lantean.QBTMudBlade/Components/MudFieldSwitch.razor.cs @@ -21,7 +21,7 @@ namespace Lantean.QBTMudBlade.Components public bool Disabled { get; set; } /// - [Parameter] + [Parameter] public object? Validation { get; set; } /// @@ -34,4 +34,4 @@ namespace Lantean.QBTMudBlade.Components await ValueChanged.InvokeAsync(value); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/NonRendering.razor.cs b/Lantean.QBTMudBlade/Components/NonRendering.razor.cs index f40dfb5..0324473 100644 --- a/Lantean.QBTMudBlade/Components/NonRendering.razor.cs +++ b/Lantean.QBTMudBlade/Components/NonRendering.razor.cs @@ -13,4 +13,4 @@ namespace Lantean.QBTMudBlade.Components [Parameter] public RenderFragment? ChildContent { get; set; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/Options/BitTorrentOptions.razor.cs b/Lantean.QBTMudBlade/Components/Options/BitTorrentOptions.razor.cs index 24aee4c..5ab6eb9 100644 --- a/Lantean.QBTMudBlade/Components/Options/BitTorrentOptions.razor.cs +++ b/Lantean.QBTMudBlade/Components/Options/BitTorrentOptions.razor.cs @@ -55,7 +55,7 @@ return null; }; - + protected Func SlowTorrentDlRateThresholdValidation = value => { if (value < 1) @@ -150,7 +150,7 @@ MaxSeedingTimeEnabled = false; MaxSeedingTime = 1440; } - + MaxRatioAct = Preferences.MaxRatioAct; if (Preferences.MaxInactiveSeedingTimeEnabled) diff --git a/Lantean.QBTMudBlade/Components/Options/ConnectionOptions.razor.cs b/Lantean.QBTMudBlade/Components/Options/ConnectionOptions.razor.cs index f7a092d..4faaf34 100644 --- a/Lantean.QBTMudBlade/Components/Options/ConnectionOptions.razor.cs +++ b/Lantean.QBTMudBlade/Components/Options/ConnectionOptions.razor.cs @@ -1,6 +1,4 @@ -using System.Numerics; - -namespace Lantean.QBTMudBlade.Components.Options +namespace Lantean.QBTMudBlade.Components.Options { public partial class ConnectionOptions : Options { @@ -97,7 +95,7 @@ namespace Lantean.QBTMudBlade.Components.Options MaxConnecEnabled = false; MaxConnec = 500; } - + if (Preferences.MaxConnecPerTorrent > 0) { MaxConnecPerTorrentEnabled = true; @@ -179,7 +177,7 @@ namespace Lantean.QBTMudBlade.Components.Options protected void MaxConnecEnabledChanged(bool value) { - MaxConnecEnabled = value; + MaxConnecEnabled = value; } protected async Task MaxConnecChanged(int value) diff --git a/Lantean.QBTMudBlade/Components/Options/SpeedOptions.razor.cs b/Lantean.QBTMudBlade/Components/Options/SpeedOptions.razor.cs index 471d303..08bda38 100644 --- a/Lantean.QBTMudBlade/Components/Options/SpeedOptions.razor.cs +++ b/Lantean.QBTMudBlade/Components/Options/SpeedOptions.razor.cs @@ -1,6 +1,4 @@ -using ByteSizeLib; - -namespace Lantean.QBTMudBlade.Components.Options +namespace Lantean.QBTMudBlade.Components.Options { public partial class SpeedOptions : Options { @@ -149,7 +147,7 @@ namespace Lantean.QBTMudBlade.Components.Options { return; } - + ScheduleFrom = value.Value; bool hasChanged = false; if (value.Value.Hours != Preferences?.ScheduleFromHour) diff --git a/Lantean.QBTMudBlade/Components/Options/WebUIOptions.razor.cs b/Lantean.QBTMudBlade/Components/Options/WebUIOptions.razor.cs index daf571a..63e8310 100644 --- a/Lantean.QBTMudBlade/Components/Options/WebUIOptions.razor.cs +++ b/Lantean.QBTMudBlade/Components/Options/WebUIOptions.razor.cs @@ -408,4 +408,4 @@ namespace Lantean.QBTMudBlade.Components.Options await JSRuntime.Open(url, true); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/PeersTab.razor.cs b/Lantean.QBTMudBlade/Components/PeersTab.razor.cs index 1231ea4..999be96 100644 --- a/Lantean.QBTMudBlade/Components/PeersTab.razor.cs +++ b/Lantean.QBTMudBlade/Components/PeersTab.razor.cs @@ -71,7 +71,7 @@ namespace Lantean.QBTMudBlade.Components { peers = await ApiClient.GetTorrentPeersData(Hash, _requestId); } - catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden || exception.StatusCode == HttpStatusCode.NotFound) { _timerCancellationToken.CancelIfNotDisposed(); return; diff --git a/Lantean.QBTMudBlade/Components/PieceProgress.razor.cs b/Lantean.QBTMudBlade/Components/PieceProgress.razor.cs index e4a1b4f..068627b 100644 --- a/Lantean.QBTMudBlade/Components/PieceProgress.razor.cs +++ b/Lantean.QBTMudBlade/Components/PieceProgress.razor.cs @@ -2,8 +2,8 @@ using Lantean.QBTMudBlade.Interop; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; -using MudBlazor.Services; using MudBlazor; +using MudBlazor.Services; namespace Lantean.QBTMudBlade.Components { @@ -25,7 +25,7 @@ namespace Lantean.QBTMudBlade.Components [EditorRequired] public IReadOnlyList Pieces { get; set; } = []; - [CascadingParameter(Name = "IsDarkMode")] + [CascadingParameter(Name = "IsDarkMode")] public bool IsDarkMode { get; set; } [CascadingParameter] @@ -100,4 +100,4 @@ namespace Lantean.QBTMudBlade.Components GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/SortLabel.razor.cs b/Lantean.QBTMudBlade/Components/SortLabel.razor.cs index f146d30..78297c5 100644 --- a/Lantean.QBTMudBlade/Components/SortLabel.razor.cs +++ b/Lantean.QBTMudBlade/Components/SortLabel.razor.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Components; using MudBlazor; using MudBlazor.Utilities; -using static MudBlazor.CategoryTypes; namespace Lantean.QBTMudBlade.Components { @@ -54,7 +53,6 @@ namespace Lantean.QBTMudBlade.Components return; } - SortDirection sortDirection; switch (SortDirection) { diff --git a/Lantean.QBTMudBlade/Components/TorrentActions.razor.cs b/Lantean.QBTMudBlade/Components/TorrentActions.razor.cs index 9535d35..3a7403c 100644 --- a/Lantean.QBTMudBlade/Components/TorrentActions.razor.cs +++ b/Lantean.QBTMudBlade/Components/TorrentActions.razor.cs @@ -4,7 +4,6 @@ using Lantean.QBTMudBlade.Interop; using Lantean.QBTMudBlade.Models; using Lantean.QBTMudBlade.Services; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; using Microsoft.JSInterop; using MudBlazor; @@ -207,7 +206,7 @@ namespace Lantean.QBTMudBlade.Components { { nameof(ManageTagsDialog.Hashes), Hashes } }; - + await DialogService.ShowAsync("Manage Torrent Tags", parameters, DialogHelper.FormDialogOptions); } @@ -327,22 +326,27 @@ namespace Lantean.QBTMudBlade.Components /// Renders toolbar contents without the wrapper. /// ToolbarContents, + /// /// Renders a . /// Toolbar, + /// /// Renders a . /// Menu, + /// /// Renders a with for basic actions and a for actions with children. /// MixedToolbarContents, + /// /// Renders toolbar contents without the wrapper with for basic actions and a for actions with children. /// MixedToolbar, + InitialIconsOnly, Children, } diff --git a/Lantean.QBTMudBlade/Components/TorrentInfo.razor.cs b/Lantean.QBTMudBlade/Components/TorrentInfo.razor.cs index 6147d91..6597e2e 100644 --- a/Lantean.QBTMudBlade/Components/TorrentInfo.razor.cs +++ b/Lantean.QBTMudBlade/Components/TorrentInfo.razor.cs @@ -24,4 +24,4 @@ namespace Lantean.QBTMudBlade.Components return torrent; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Components/TrackersTab.razor.cs b/Lantean.QBTMudBlade/Components/TrackersTab.razor.cs index 8379c0a..0682b8f 100644 --- a/Lantean.QBTMudBlade/Components/TrackersTab.razor.cs +++ b/Lantean.QBTMudBlade/Components/TrackersTab.razor.cs @@ -59,7 +59,7 @@ namespace Lantean.QBTMudBlade.Components { Trackers = await ApiClient.GetTorrentTrackers(Hash); } - catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden || exception.StatusCode == HttpStatusCode.NotFound) { _timerCancellationToken.CancelIfNotDisposed(); return; diff --git a/Lantean.QBTMudBlade/Components/WebSeedsTab.razor.cs b/Lantean.QBTMudBlade/Components/WebSeedsTab.razor.cs index 3184dc5..f7a8109 100644 --- a/Lantean.QBTMudBlade/Components/WebSeedsTab.razor.cs +++ b/Lantean.QBTMudBlade/Components/WebSeedsTab.razor.cs @@ -65,7 +65,7 @@ namespace Lantean.QBTMudBlade.Components { WebSeeds = await ApiClient.GetTorrentWebSeeds(Hash); } - catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden || exception.StatusCode == HttpStatusCode.NotFound) { _timerCancellationToken.CancelIfNotDisposed(); return; diff --git a/Lantean.QBTMudBlade/DialogHelper.cs b/Lantean.QBTMudBlade/DialogHelper.cs index ae7cd7a..000979c 100644 --- a/Lantean.QBTMudBlade/DialogHelper.cs +++ b/Lantean.QBTMudBlade/DialogHelper.cs @@ -4,7 +4,6 @@ using Lantean.QBTMudBlade.Components.Dialogs; using Lantean.QBTMudBlade.Filter; using Lantean.QBTMudBlade.Models; using MudBlazor; -using System.Collections.Generic; namespace Lantean.QBTMudBlade { @@ -265,7 +264,7 @@ namespace Lantean.QBTMudBlade return default; } - return ((HashSet, Dictionary))result.Data; + return ((HashSet, Dictionary))result.Data; } public static async Task InvokeRssRulesDialog(this IDialogService dialogService) @@ -286,4 +285,4 @@ namespace Lantean.QBTMudBlade await dialogService.ShowAsync(parent.Name, parameters, FormDialogOptions); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/DisplayHelpers.cs b/Lantean.QBTMudBlade/DisplayHelpers.cs index 945f97f..12f5022 100644 --- a/Lantean.QBTMudBlade/DisplayHelpers.cs +++ b/Lantean.QBTMudBlade/DisplayHelpers.cs @@ -2,7 +2,6 @@ using Lantean.QBTMudBlade.Models; using MudBlazor; using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Text; namespace Lantean.QBTMudBlade @@ -341,32 +340,43 @@ namespace Lantean.QBTMudBlade case "forcedMetaDL": case "downloading": return (Icons.Material.Filled.Downloading, Color.Success); + case "forcedUP": case "uploading": return (Icons.Material.Filled.Upload, Color.Info); + case "stalledUP": return (Icons.Material.Filled.KeyboardDoubleArrowUp, Color.Info); + case "stalledDL": return (Icons.Material.Filled.KeyboardDoubleArrowDown, Color.Success); + case "pausedDL": return (Icons.Material.Filled.Pause, Color.Success); + case "pausedUP": return (Icons.Material.Filled.Pause, Color.Info); + case "queuedDL": case "queuedUP": return (Icons.Material.Filled.Queue, Color.Default); + case "checkingDL": case "checkingUP": return (Icons.Material.Filled.Loop, Color.Info); + case "queuedForChecking": case "checkingResumeData": return (Icons.Material.Filled.Loop, Color.Warning); + case "moving": return (Icons.Material.Filled.Moving, Color.Info); + case "error": case "unknown": case "missingFiles": return (Icons.Material.Filled.Error, Color.Error); + default: return (Icons.Material.Filled.QuestionMark, Color.Warning); } diff --git a/Lantean.QBTMudBlade/ExpressionModifier.cs b/Lantean.QBTMudBlade/ExpressionModifier.cs index cd150bb..909d0a7 100644 --- a/Lantean.QBTMudBlade/ExpressionModifier.cs +++ b/Lantean.QBTMudBlade/ExpressionModifier.cs @@ -81,7 +81,7 @@ namespace Lantean.QBTMudBlade var propertyExpression = Expression.Property(parameterExpression, propertyInfo); var convertExpression = Expression.Convert(propertyExpression, typeof(object)); - return (Expression.Lambda>(convertExpression, parameterExpression), propertyInfo.PropertyType); + return (Expression.Lambda>(convertExpression, parameterExpression), propertyInfo.PropertyType); } } diff --git a/Lantean.QBTMudBlade/Extensions.cs b/Lantean.QBTMudBlade/Extensions.cs index a7a4c93..189700d 100644 --- a/Lantean.QBTMudBlade/Extensions.cs +++ b/Lantean.QBTMudBlade/Extensions.cs @@ -1,5 +1,4 @@ -using Lantean.QBTMudBlade; -using Lantean.QBTMudBlade.Models; +using Lantean.QBTMudBlade.Models; namespace Lantean.QBTMudBlade { diff --git a/Lantean.QBTMudBlade/Filter/FilterExpressionGenerator.cs b/Lantean.QBTMudBlade/Filter/FilterExpressionGenerator.cs index f62c35d..3fc25e0 100644 --- a/Lantean.QBTMudBlade/Filter/FilterExpressionGenerator.cs +++ b/Lantean.QBTMudBlade/Filter/FilterExpressionGenerator.cs @@ -41,7 +41,7 @@ namespace Lantean.QBTMudBlade.Filter propertyExpression.Modify((Expression>)(x => (string?)x != null && value != null && ((string)x).StartsWith(value, stringComparer))), FilterOperator.String.EndsWith => propertyExpression.Modify((Expression>)(x => (string?)x != null && value != null && ((string)x).EndsWith(value, stringComparer))), - FilterOperator.String.Empty => + FilterOperator.String.Empty => propertyExpression.Modify((Expression>)(x => string.IsNullOrWhiteSpace(x))), FilterOperator.String.NotEmpty => propertyExpression.Modify((Expression>)(x => !string.IsNullOrWhiteSpace(x))), diff --git a/Lantean.QBTMudBlade/FilterHelper.cs b/Lantean.QBTMudBlade/FilterHelper.cs index 0dd4005..b95fced 100644 --- a/Lantean.QBTMudBlade/FilterHelper.cs +++ b/Lantean.QBTMudBlade/FilterHelper.cs @@ -171,7 +171,6 @@ namespace Lantean.QBTMudBlade public static bool FilterStatus(string state, long uploadSpeed, Status status) { - bool inactive = false; switch (status) { diff --git a/Lantean.QBTMudBlade/Interop/InteropHelper.cs b/Lantean.QBTMudBlade/Interop/InteropHelper.cs index cf4da2f..435caac 100644 --- a/Lantean.QBTMudBlade/Interop/InteropHelper.cs +++ b/Lantean.QBTMudBlade/Interop/InteropHelper.cs @@ -26,7 +26,7 @@ namespace Lantean.QBTMudBlade.Interop public static async Task RenderPiecesBar(this IJSRuntime runtime, string id, string hash, int[] pieces, string? downloadingColor = null, string? haveColor = null, string? borderColor = null) { - await runtime.InvokeVoidAsync("qbt.renderPiecesBar", id, hash, pieces, downloadingColor, haveColor, borderColor ); + await runtime.InvokeVoidAsync("qbt.renderPiecesBar", id, hash, pieces, downloadingColor, haveColor, borderColor); } } } \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Layout/DetailsLayout.razor.cs b/Lantean.QBTMudBlade/Layout/DetailsLayout.razor.cs index 8382b28..1bc1adb 100644 --- a/Lantean.QBTMudBlade/Layout/DetailsLayout.razor.cs +++ b/Lantean.QBTMudBlade/Layout/DetailsLayout.razor.cs @@ -18,7 +18,6 @@ namespace Lantean.QBTMudBlade.Layout [CascadingParameter(Name = "SortDirection")] public SortDirection SortDirection { get; set; } - protected string? SelectedTorrent { get; set; } protected override void OnParametersSet() @@ -34,4 +33,4 @@ namespace Lantean.QBTMudBlade.Layout } } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Layout/ListLayout.razor.cs b/Lantean.QBTMudBlade/Layout/ListLayout.razor.cs index 710823c..84a32d0 100644 --- a/Lantean.QBTMudBlade/Layout/ListLayout.razor.cs +++ b/Lantean.QBTMudBlade/Layout/ListLayout.razor.cs @@ -23,4 +23,4 @@ namespace Lantean.QBTMudBlade.Layout [CascadingParameter(Name = "SearchTermChanged")] public EventCallback SearchTermChanged { get; set; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Models/ContentItem.cs b/Lantean.QBTMudBlade/Models/ContentItem.cs index bf12d03..dc44555 100644 --- a/Lantean.QBTMudBlade/Models/ContentItem.cs +++ b/Lantean.QBTMudBlade/Models/ContentItem.cs @@ -21,7 +21,7 @@ namespace Lantean.QBTMudBlade.Models Index = index; Priority = priority; Progress = progress; - Size = size; + Size = priority == Priority.DoNotDownload ? 0 : size; Availability = availability; IsFolder = isFolder; Level = level; diff --git a/Lantean.QBTMudBlade/Pages/Login.razor.cs b/Lantean.QBTMudBlade/Pages/Login.razor.cs index 1de1f90..c619ec4 100644 --- a/Lantean.QBTMudBlade/Pages/Login.razor.cs +++ b/Lantean.QBTMudBlade/Pages/Login.razor.cs @@ -32,11 +32,11 @@ namespace Lantean.QBTMudBlade.Pages NavigationManager.NavigateTo("/"); } - catch (HttpRequestException ex) when (ex.StatusCode == HttpStatusCode.BadRequest) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.BadRequest) { ApiError = "Invalid username or password."; } - catch (HttpRequestException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) + catch (HttpRequestException exception) when (exception.StatusCode == HttpStatusCode.Forbidden) { ApiError = "Requests from this client are currently unavailable."; } @@ -47,10 +47,12 @@ namespace Lantean.QBTMudBlade.Pages } #if DEBUG + protected override async Task OnInitializedAsync() { await DoLogin("admin", "23mIDZhvT"); } + #endif } diff --git a/Lantean.QBTMudBlade/Pages/Options.razor.cs b/Lantean.QBTMudBlade/Pages/Options.razor.cs index be2cb41..e6f02c5 100644 --- a/Lantean.QBTMudBlade/Pages/Options.razor.cs +++ b/Lantean.QBTMudBlade/Pages/Options.razor.cs @@ -129,6 +129,4 @@ namespace Lantean.QBTMudBlade.Pages UpdatePreferences = null; } } -} - - +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Program.cs b/Lantean.QBTMudBlade/Program.cs index c4f311a..430d7b7 100644 --- a/Lantean.QBTMudBlade/Program.cs +++ b/Lantean.QBTMudBlade/Program.cs @@ -1,10 +1,9 @@ +using Blazored.LocalStorage; using Lantean.QBitTorrentClient; using Lantean.QBTMudBlade.Services; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using MudBlazor.Services; -using Blazored; -using Blazored.LocalStorage; namespace Lantean.QBTMudBlade { @@ -52,4 +51,4 @@ namespace Lantean.QBTMudBlade await builder.Build().RunAsync(); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Properties/launchSettings.json b/Lantean.QBTMudBlade/Properties/launchSettings.json index 2c830b0..10492c3 100644 --- a/Lantean.QBTMudBlade/Properties/launchSettings.json +++ b/Lantean.QBTMudBlade/Properties/launchSettings.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Services/ClipboardService.cs b/Lantean.QBTMudBlade/Services/ClipboardService.cs index 327b580..1825c5f 100644 --- a/Lantean.QBTMudBlade/Services/ClipboardService.cs +++ b/Lantean.QBTMudBlade/Services/ClipboardService.cs @@ -16,4 +16,4 @@ namespace Lantean.QBTMudBlade.Services await _jSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Services/DataManager.cs b/Lantean.QBTMudBlade/Services/DataManager.cs index 02e2df1..7a14fd9 100644 --- a/Lantean.QBTMudBlade/Services/DataManager.cs +++ b/Lantean.QBTMudBlade/Services/DataManager.cs @@ -615,7 +615,6 @@ namespace Lantean.QBTMudBlade.Services downloaded = downloadingContents.Sum(c => c.Value.Downloaded); progress = (float)downloaded / size; } - if (!contents.TryGetValue(key, out var dir)) { diff --git a/Lantean.QBTMudBlade/Services/HttpLogger.cs b/Lantean.QBTMudBlade/Services/HttpLogger.cs index aee0e89..545fcbd 100644 --- a/Lantean.QBTMudBlade/Services/HttpLogger.cs +++ b/Lantean.QBTMudBlade/Services/HttpLogger.cs @@ -46,4 +46,4 @@ namespace Lantean.QBTMudBlade.Services elapsed.TotalMilliseconds.ToString("F1")); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/Services/IClipboardService.cs b/Lantean.QBTMudBlade/Services/IClipboardService.cs index 96da59b..e19bd3d 100644 --- a/Lantean.QBTMudBlade/Services/IClipboardService.cs +++ b/Lantean.QBTMudBlade/Services/IClipboardService.cs @@ -4,4 +4,4 @@ { Task WriteToClipboard(string text); } -} +} \ No newline at end of file diff --git a/Lantean.QBTMudBlade/wwwroot/css/app.css b/Lantean.QBTMudBlade/wwwroot/css/app.css index 84d7db8..17ed134 100644 --- a/Lantean.QBTMudBlade/wwwroot/css/app.css +++ b/Lantean.QBTMudBlade/wwwroot/css/app.css @@ -85,9 +85,9 @@ code { padding-bottom: 0 !important; } -.table-progress .progress-expand { - height: 28px !important; -} + .table-progress .progress-expand { + height: 28px !important; + } td.no-wrap { white-space: nowrap; /* Prevent text from wrapping to the next line */ @@ -109,7 +109,6 @@ td.no-wrap { } .field-switch { - } .piecesbarWrapper { diff --git a/Lantean.QBTMudBlade/wwwroot/js/interop.js b/Lantean.QBTMudBlade/wwwroot/js/interop.js index 51ce245..92fc32d 100644 --- a/Lantean.QBTMudBlade/wwwroot/js/interop.js +++ b/Lantean.QBTMudBlade/wwwroot/js/interop.js @@ -49,6 +49,6 @@ window.qbt.renderPiecesBar = (id, hash, pieces, downloadingColor, haveColor, bor const el = window.qbt.piecesBar.createElement(); parentElement.appendChild(el); } - + window.qbt.piecesBar.setPieces(pieces); } \ No newline at end of file diff --git a/Lantean.QBTMudBlade/wwwroot/js/piecesbar.js b/Lantean.QBTMudBlade/wwwroot/js/piecesbar.js index 515c0c2..0c0120a 100644 --- a/Lantean.QBTMudBlade/wwwroot/js/piecesbar.js +++ b/Lantean.QBTMudBlade/wwwroot/js/piecesbar.js @@ -44,7 +44,6 @@ class PiecesBar { MAX_CANVAS_WIDTH = 4096; constructor(pieces, parameters) { - this.id = 'piecesbar_' + (window.qbt.piecesBarUniqueId++); this.width = 0; this.height = 0; @@ -270,4 +269,4 @@ class PiecesBar { window.qbt.PiecesBar = PiecesBar; -Object.freeze(window.qbt.PiecesBar); +Object.freeze(window.qbt.PiecesBar); \ No newline at end of file diff --git a/Lantean.QBitTorrentClient/ApiClient.cs b/Lantean.QBitTorrentClient/ApiClient.cs index 92fecd1..a508060 100644 --- a/Lantean.QBitTorrentClient/ApiClient.cs +++ b/Lantean.QBitTorrentClient/ApiClient.cs @@ -1,5 +1,4 @@ using Lantean.QBitTorrentClient.Models; -using System; using System.Net; using System.Net.Http.Json; using System.Text.Json; diff --git a/Lantean.QBitTorrentClient/ApiClientExtensions.cs b/Lantean.QBitTorrentClient/ApiClientExtensions.cs index 63d82fa..d3c126f 100644 --- a/Lantean.QBitTorrentClient/ApiClientExtensions.cs +++ b/Lantean.QBitTorrentClient/ApiClientExtensions.cs @@ -120,7 +120,6 @@ namespace Lantean.QBitTorrentClient { return apiClient.AddTorrentTags([tag], null, hashes.ToArray()); } - public static Task RecheckTorrent(this IApiClient apiClient, string hash) { diff --git a/Lantean.QBitTorrentClient/HttpClientExtensions.cs b/Lantean.QBitTorrentClient/HttpClientExtensions.cs index 5045b19..77be5e0 100644 --- a/Lantean.QBitTorrentClient/HttpClientExtensions.cs +++ b/Lantean.QBitTorrentClient/HttpClientExtensions.cs @@ -12,4 +12,4 @@ return httpClient.GetAsync($"{requestUrl}{builder.ToQueryString()}"); } } -} +} \ No newline at end of file diff --git a/Lantean.QBitTorrentClient/Models/SaveLocation.cs b/Lantean.QBitTorrentClient/Models/SaveLocation.cs index 62855a1..9565e51 100644 --- a/Lantean.QBitTorrentClient/Models/SaveLocation.cs +++ b/Lantean.QBitTorrentClient/Models/SaveLocation.cs @@ -1,5 +1,4 @@ - -namespace Lantean.QBitTorrentClient.Models +namespace Lantean.QBitTorrentClient.Models { public class SaveLocation { @@ -79,4 +78,4 @@ namespace Lantean.QBitTorrentClient.Models return ToValue().ToString(); } } -} +} \ No newline at end of file