From 7db4f2f78de93632916754fbc8839d8049df63de Mon Sep 17 00:00:00 2001 From: ahjephson <16685186+ahjephson@users.noreply.github.com> Date: Mon, 20 Oct 2025 14:54:31 +0100 Subject: [PATCH] Fix final issues with longpress. Update all files to use correct encoding and ran through CodeMaid. --- Lantean.QBTMud.Test/UnitTest1.cs | 2 +- .../Components/Dialogs/AddTagDialog.razor.cs | 2 +- .../Dialogs/AddTorrentFileDialog.razor.cs | 2 +- .../Dialogs/AddTorrentLinkDialog.razor.cs | 2 +- .../Components/Dialogs/AddTorrentOptions.razor | 2 +- .../Dialogs/AddTorrentOptions.razor.cs | 1 - .../Dialogs/AddTrackerDialog.razor.cs | 2 +- .../Dialogs/CategoryPropertiesDialog.razor.cs | 2 +- .../Components/Dialogs/ConfirmDialog.razor.cs | 2 +- .../Components/Dialogs/DeleteDialog.razor.cs | 2 +- .../Components/Dialogs/ExceptionDialog.razor.cs | 2 +- .../Dialogs/FilterOptionsDialog.razor.cs | 2 +- .../Dialogs/ManageCategoriesDialog.razor.cs | 2 +- .../Dialogs/ManageTagsDialog.razor.cs | 2 +- .../Dialogs/MultipleFieldDialog.razor.cs | 2 +- .../Dialogs/NumericFieldDialog.razor.cs | 2 +- .../Dialogs/RenameFilesDialog.razor.cs | 5 ++--- .../Components/Dialogs/RssRulesDialog.razor.cs | 2 +- .../Dialogs/ShareRatioDialog.razor.cs | 2 +- .../Dialogs/SliderFieldDialog.razor.cs | 2 +- .../Dialogs/StringFieldDialog.razor.cs | 2 +- .../Components/Dialogs/SubMenuDialog.razor.cs | 2 +- .../Dialogs/TorrentOptionsDialog.razor.cs | 2 +- Lantean.QBTMud/Components/FilesTab.razor | 2 +- Lantean.QBTMud/Components/FilesTab.razor.cs | 3 +-- Lantean.QBTMud/Components/FiltersNav.razor | 8 ++++---- Lantean.QBTMud/Components/FiltersNav.razor.cs | 2 +- Lantean.QBTMud/Components/GeneralTab.razor | 2 +- .../Components/Options/AdvancedOptions.razor | 2 +- Lantean.QBTMud/Components/PeersTab.razor | 2 +- Lantean.QBTMud/Components/PeersTab.razor.cs | 2 +- Lantean.QBTMud/Components/TrackersTab.razor | 2 +- Lantean.QBTMud/Components/TrackersTab.razor.cs | 2 +- .../Components/UI/CustomNavLink.razor | 2 +- .../Components/UI/CustomNavLink.razor.cs | 2 +- .../Components/UI/DynamicTable.razor.cs | 17 +++++++++++++++-- Lantean.QBTMud/Components/UI/TdExtended.razor | 4 ++-- Lantean.QBTMud/Helpers/DisplayHelpers.cs | 1 - Lantean.QBTMud/Helpers/EventArgsExtensions.cs | 17 +++++------------ Lantean.QBTMud/Helpers/FilterHelper.cs | 1 + Lantean.QBTMud/Helpers/VersionHelper.cs | 5 ++--- Lantean.QBTMud/Layout/LoggedInLayout.razor | 2 +- Lantean.QBTMud/Layout/LoggedInLayout.razor.cs | 7 ++----- Lantean.QBTMud/Models/FileRow.cs | 6 +++--- Lantean.QBTMud/Models/Status.cs | 1 - Lantean.QBTMud/Models/TorrentOptions.cs | 4 +--- Lantean.QBTMud/Pages/Statistics.razor | 2 +- Lantean.QBTMud/Pages/TorrentList.razor | 2 +- Lantean.QBTMud/Pages/TorrentList.razor.cs | 4 ++-- Lantean.QBTMud/Program.cs | 2 +- Lantean.QBTMud/Services/DataManager.cs | 5 ++--- Lantean.QBTMud/Services/IDataManager.cs | 2 +- Lantean.QBTMud/wwwroot/index.html | 2 +- Lantean.QBTMud/wwwroot/js/longpress.js | 2 +- .../Models/AddTorrentParams.cs | 4 ++-- 55 files changed, 82 insertions(+), 87 deletions(-) diff --git a/Lantean.QBTMud.Test/UnitTest1.cs b/Lantean.QBTMud.Test/UnitTest1.cs index 06de721..47d2a0c 100644 --- a/Lantean.QBTMud.Test/UnitTest1.cs +++ b/Lantean.QBTMud.Test/UnitTest1.cs @@ -1,4 +1,4 @@ -using Lantean.QBitTorrentClient; +using Lantean.QBitTorrentClient; using Lantean.QBitTorrentClient.Models; using System.Linq.Expressions; using System.Text.Json; diff --git a/Lantean.QBTMud/Components/Dialogs/AddTagDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/AddTagDialog.razor.cs index fe0b548..a7f15c6 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTagDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/AddTagDialog.razor.cs @@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs protected IDialogService DialogService { get; set; } = default!; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; protected HashSet Tags { get; } = []; diff --git a/Lantean.QBTMud/Components/Dialogs/AddTorrentFileDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/AddTorrentFileDialog.razor.cs index df3d257..6d0281b 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTorrentFileDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/AddTorrentFileDialog.razor.cs @@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class AddTorrentFileDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; protected IReadOnlyList Files { get; set; } = []; diff --git a/Lantean.QBTMud/Components/Dialogs/AddTorrentLinkDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/AddTorrentLinkDialog.razor.cs index f067f6e..24f827c 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTorrentLinkDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/AddTorrentLinkDialog.razor.cs @@ -18,7 +18,7 @@ namespace Lantean.QBTMud.Components.Dialogs protected IKeyboardService KeyboardService { get; set; } = default!; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Url { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor b/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor index aa2050b..c2518d0 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor +++ b/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor @@ -65,4 +65,4 @@ - + \ No newline at end of file diff --git a/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor.cs b/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor.cs index 6b04504..fa298b2 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/AddTorrentOptions.razor.cs @@ -1,7 +1,6 @@ using Lantean.QBitTorrentClient; using Lantean.QBTMud.Models; using Microsoft.AspNetCore.Components; -using MudBlazor; namespace Lantean.QBTMud.Components.Dialogs { diff --git a/Lantean.QBTMud/Components/Dialogs/AddTrackerDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/AddTrackerDialog.razor.cs index 5e38331..8eb5bf6 100644 --- a/Lantean.QBTMud/Components/Dialogs/AddTrackerDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/AddTrackerDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class AddTrackerDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; protected HashSet Trackers { get; } = []; diff --git a/Lantean.QBTMud/Components/Dialogs/CategoryPropertiesDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/CategoryPropertiesDialog.razor.cs index def40d0..00da02d 100644 --- a/Lantean.QBTMud/Components/Dialogs/CategoryPropertiesDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/CategoryPropertiesDialog.razor.cs @@ -10,7 +10,7 @@ namespace Lantean.QBTMud.Components.Dialogs private string _savePath = string.Empty; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Inject] protected IApiClient ApiClient { get; set; } = default!; diff --git a/Lantean.QBTMud/Components/Dialogs/ConfirmDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/ConfirmDialog.razor.cs index ae53c5b..de383ea 100644 --- a/Lantean.QBTMud/Components/Dialogs/ConfirmDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/ConfirmDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class ConfirmDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string Content { get; set; } = default!; diff --git a/Lantean.QBTMud/Components/Dialogs/DeleteDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/DeleteDialog.razor.cs index 39b0ce3..a090073 100644 --- a/Lantean.QBTMud/Components/Dialogs/DeleteDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/DeleteDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class DeleteDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public int Count { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/ExceptionDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/ExceptionDialog.razor.cs index ab33d25..a61b67e 100644 --- a/Lantean.QBTMud/Components/Dialogs/ExceptionDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/ExceptionDialog.razor.cs @@ -6,7 +6,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class ExceptionDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public Exception? Exception { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/FilterOptionsDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/FilterOptionsDialog.razor.cs index 5661fe0..3cc1ad7 100644 --- a/Lantean.QBTMud/Components/Dialogs/FilterOptionsDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/FilterOptionsDialog.razor.cs @@ -11,7 +11,7 @@ namespace Lantean.QBTMud.Components.Dialogs private static readonly IReadOnlyList _properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public); [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; protected IReadOnlyList Columns => _properties; diff --git a/Lantean.QBTMud/Components/Dialogs/ManageCategoriesDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/ManageCategoriesDialog.razor.cs index b40ac5a..2ff0292 100644 --- a/Lantean.QBTMud/Components/Dialogs/ManageCategoriesDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/ManageCategoriesDialog.razor.cs @@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs protected IDialogService DialogService { get; set; } = default!; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public IEnumerable Hashes { get; set; } = []; diff --git a/Lantean.QBTMud/Components/Dialogs/ManageTagsDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/ManageTagsDialog.razor.cs index 247ca66..bc182ce 100644 --- a/Lantean.QBTMud/Components/Dialogs/ManageTagsDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/ManageTagsDialog.razor.cs @@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs protected IDialogService DialogService { get; set; } = default!; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public IEnumerable Hashes { get; set; } = []; diff --git a/Lantean.QBTMud/Components/Dialogs/MultipleFieldDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/MultipleFieldDialog.razor.cs index 4507957..8f466ff 100644 --- a/Lantean.QBTMud/Components/Dialogs/MultipleFieldDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/MultipleFieldDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class MultipleFieldDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string Label { get; set; } = default!; diff --git a/Lantean.QBTMud/Components/Dialogs/NumericFieldDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/NumericFieldDialog.razor.cs index e369476..da26a06 100644 --- a/Lantean.QBTMud/Components/Dialogs/NumericFieldDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/NumericFieldDialog.razor.cs @@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class NumericFieldDialog where T : struct, INumber { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Label { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/RenameFilesDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/RenameFilesDialog.razor.cs index d50d966..a6267f4 100644 --- a/Lantean.QBTMud/Components/Dialogs/RenameFilesDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/RenameFilesDialog.razor.cs @@ -30,7 +30,7 @@ namespace Lantean.QBTMud.Components.Dialogs protected ILocalStorageService LocalStorage { get; set; } = default!; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Hash { get; set; } @@ -426,7 +426,6 @@ namespace Lantean.QBTMud.Components.Dialogs { await LocalStorage.RemoveItemAsync(_preferencesStorageKey); } - } protected override async Task OnInitializedAsync() @@ -495,7 +494,7 @@ namespace Lantean.QBTMud.Components.Dialogs { var oldPath = renamedFile.Path + renamedFile.OriginalName; var newPath = renamedFile.Path + renamedFile.NewName; - + await ApiClient.RenameFolder(Hash, oldPath, newPath); } diff --git a/Lantean.QBTMud/Components/Dialogs/RssRulesDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/RssRulesDialog.razor.cs index 075589d..71f6863 100644 --- a/Lantean.QBTMud/Components/Dialogs/RssRulesDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/RssRulesDialog.razor.cs @@ -10,7 +10,7 @@ namespace Lantean.QBTMud.Components.Dialogs private readonly List _unsavedRuleNames = []; [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Inject] protected IDialogService DialogService { get; set; } = default!; diff --git a/Lantean.QBTMud/Components/Dialogs/ShareRatioDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/ShareRatioDialog.razor.cs index b8de866..1ff44fe 100644 --- a/Lantean.QBTMud/Components/Dialogs/ShareRatioDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/ShareRatioDialog.razor.cs @@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class ShareRatioDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Label { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/SliderFieldDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/SliderFieldDialog.razor.cs index aeb3da1..9ecdcba 100644 --- a/Lantean.QBTMud/Components/Dialogs/SliderFieldDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/SliderFieldDialog.razor.cs @@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class SliderFieldDialog where T : struct, INumber { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Label { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/StringFieldDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/StringFieldDialog.razor.cs index fc8afb8..0ffacd0 100644 --- a/Lantean.QBTMud/Components/Dialogs/StringFieldDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/StringFieldDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class StringFieldDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public string? Label { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/SubMenuDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/SubMenuDialog.razor.cs index a2e36d4..bca93db 100644 --- a/Lantean.QBTMud/Components/Dialogs/SubMenuDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/SubMenuDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class SubMenuDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] public UIAction? ParentAction { get; set; } diff --git a/Lantean.QBTMud/Components/Dialogs/TorrentOptionsDialog.razor.cs b/Lantean.QBTMud/Components/Dialogs/TorrentOptionsDialog.razor.cs index 1490b36..e06fc77 100644 --- a/Lantean.QBTMud/Components/Dialogs/TorrentOptionsDialog.razor.cs +++ b/Lantean.QBTMud/Components/Dialogs/TorrentOptionsDialog.razor.cs @@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs public partial class TorrentOptionsDialog { [CascadingParameter] - IMudDialogInstance MudDialog { get; set; } = default!; + private IMudDialogInstance MudDialog { get; set; } = default!; [Parameter] [EditorRequired] diff --git a/Lantean.QBTMud/Components/FilesTab.razor b/Lantean.QBTMud/Components/FilesTab.razor index e29fc65..825d2b7 100644 --- a/Lantean.QBTMud/Components/FilesTab.razor +++ b/Lantean.QBTMud/Components/FilesTab.razor @@ -1,4 +1,4 @@ - + Rename diff --git a/Lantean.QBTMud/Components/FilesTab.razor.cs b/Lantean.QBTMud/Components/FilesTab.razor.cs index 96f7c05..be35377 100644 --- a/Lantean.QBTMud/Components/FilesTab.razor.cs +++ b/Lantean.QBTMud/Components/FilesTab.razor.cs @@ -8,7 +8,6 @@ using Lantean.QBTMud.Models; using Lantean.QBTMud.Services; using Microsoft.AspNetCore.Components; using MudBlazor; -using System; using System.Collections.ObjectModel; using System.Net; @@ -630,4 +629,4 @@ namespace Lantean.QBTMud.Components ColumnDefinitionHelper.CreateColumnDefinition("Availability", c => c.Availability, c => c.Availability.ToString("0.00")), ]; } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/FiltersNav.razor b/Lantean.QBTMud/Components/FiltersNav.razor index 9b26cbe..cdc289a 100644 --- a/Lantean.QBTMud/Components/FiltersNav.razor +++ b/Lantean.QBTMud/Components/FiltersNav.razor @@ -1,8 +1,8 @@ - + @TorrentControls(_statusType) - + Add category @if (IsCategoryTarget) { @@ -14,7 +14,7 @@ @TorrentControls(_categoryType) - + Add tag @if (IsTagTarget) { @@ -25,7 +25,7 @@ @TorrentControls(_tagType) - + Remove tracker @TorrentControls(_trackerType) diff --git a/Lantean.QBTMud/Components/FiltersNav.razor.cs b/Lantean.QBTMud/Components/FiltersNav.razor.cs index d066e23..b8a7941 100644 --- a/Lantean.QBTMud/Components/FiltersNav.razor.cs +++ b/Lantean.QBTMud/Components/FiltersNav.razor.cs @@ -477,4 +477,4 @@ namespace Lantean.QBTMud.Components } } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/GeneralTab.razor b/Lantean.QBTMud/Components/GeneralTab.razor index d3a119d..ec2501e 100644 --- a/Lantean.QBTMud/Components/GeneralTab.razor +++ b/Lantean.QBTMud/Components/GeneralTab.razor @@ -98,4 +98,4 @@ @Properties?.Comment - + \ No newline at end of file diff --git a/Lantean.QBTMud/Components/Options/AdvancedOptions.razor b/Lantean.QBTMud/Components/Options/AdvancedOptions.razor index 0bcac22..1c63590 100644 --- a/Lantean.QBTMud/Components/Options/AdvancedOptions.razor +++ b/Lantean.QBTMud/Components/Options/AdvancedOptions.razor @@ -240,4 +240,4 @@ - + \ No newline at end of file diff --git a/Lantean.QBTMud/Components/PeersTab.razor b/Lantean.QBTMud/Components/PeersTab.razor index faa0949..72ca833 100644 --- a/Lantean.QBTMud/Components/PeersTab.razor +++ b/Lantean.QBTMud/Components/PeersTab.razor @@ -1,4 +1,4 @@ - + Add peer @if (ContextMenuItem is not null) { diff --git a/Lantean.QBTMud/Components/PeersTab.razor.cs b/Lantean.QBTMud/Components/PeersTab.razor.cs index eb094f2..1d710d5 100644 --- a/Lantean.QBTMud/Components/PeersTab.razor.cs +++ b/Lantean.QBTMud/Components/PeersTab.razor.cs @@ -257,4 +257,4 @@ namespace Lantean.QBTMud.Components GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/TrackersTab.razor b/Lantean.QBTMud/Components/TrackersTab.razor index 26c23f5..c5a8d58 100644 --- a/Lantean.QBTMud/Components/TrackersTab.razor +++ b/Lantean.QBTMud/Components/TrackersTab.razor @@ -1,4 +1,4 @@ - + Add trackers @if (ContextMenuItem is not null) { diff --git a/Lantean.QBTMud/Components/TrackersTab.razor.cs b/Lantean.QBTMud/Components/TrackersTab.razor.cs index eda4c95..2697924 100644 --- a/Lantean.QBTMud/Components/TrackersTab.razor.cs +++ b/Lantean.QBTMud/Components/TrackersTab.razor.cs @@ -303,4 +303,4 @@ namespace Lantean.QBTMud.Components GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/UI/CustomNavLink.razor b/Lantean.QBTMud/Components/UI/CustomNavLink.razor index 4e800d7..624aec2 100644 --- a/Lantean.QBTMud/Components/UI/CustomNavLink.razor +++ b/Lantean.QBTMud/Components/UI/CustomNavLink.razor @@ -1,5 +1,5 @@ 
-
+
@if (!string.IsNullOrEmpty(Icon)) { diff --git a/Lantean.QBTMud/Components/UI/CustomNavLink.razor.cs b/Lantean.QBTMud/Components/UI/CustomNavLink.razor.cs index 2fc9eb8..4cbf21c 100644 --- a/Lantean.QBTMud/Components/UI/CustomNavLink.razor.cs +++ b/Lantean.QBTMud/Components/UI/CustomNavLink.razor.cs @@ -87,4 +87,4 @@ namespace Lantean.QBTMud.Components.UI return OnContextMenu.InvokeAsync(e); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/UI/DynamicTable.razor.cs b/Lantean.QBTMud/Components/UI/DynamicTable.razor.cs index 5c2100e..e013a44 100644 --- a/Lantean.QBTMud/Components/UI/DynamicTable.razor.cs +++ b/Lantean.QBTMud/Components/UI/DynamicTable.razor.cs @@ -4,7 +4,6 @@ using Lantean.QBTMud.Models; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using MudBlazor; -using System; namespace Lantean.QBTMud.Components.UI { @@ -92,6 +91,8 @@ namespace Lantean.QBTMud.Components.UI private SortDirection _sortDirection; + private DateTimeOffset? _suppressRowClickUntil; + private readonly Dictionary _tds = []; private IReadOnlyList> _visibleColumns = EmptyColumns; @@ -287,6 +288,17 @@ namespace Lantean.QBTMud.Components.UI protected async Task OnRowClickInternal(TableRowClickEventArgs eventArgs) { + if (_suppressRowClickUntil is not null) + { + if (DateTimeOffset.UtcNow <= _suppressRowClickUntil.Value) + { + _suppressRowClickUntil = null; + return; + } + + _suppressRowClickUntil = null; + } + if (eventArgs.Item is null) { return; @@ -362,6 +374,7 @@ namespace Lantean.QBTMud.Components.UI protected Task OnLongPressInternal(LongPressEventArgs eventArgs, string columnId, T item) { + _suppressRowClickUntil = DateTimeOffset.UtcNow.AddMilliseconds(500); var data = _tds[columnId]; return OnTableDataLongPress.InvokeAsync(new TableDataLongPressEventArgs(eventArgs, data, item)); } @@ -476,4 +489,4 @@ namespace Lantean.QBTMud.Components.UI public SortDirection SortDirection { get; init; } } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Components/UI/TdExtended.razor b/Lantean.QBTMud/Components/UI/TdExtended.razor index 98af236..2fee199 100644 --- a/Lantean.QBTMud/Components/UI/TdExtended.razor +++ b/Lantean.QBTMud/Components/UI/TdExtended.razor @@ -1,5 +1,5 @@ @inherits MudTd - + @ChildContent - + \ No newline at end of file diff --git a/Lantean.QBTMud/Helpers/DisplayHelpers.cs b/Lantean.QBTMud/Helpers/DisplayHelpers.cs index dae2f82..ebd50cf 100644 --- a/Lantean.QBTMud/Helpers/DisplayHelpers.cs +++ b/Lantean.QBTMud/Helpers/DisplayHelpers.cs @@ -83,7 +83,6 @@ namespace Lantean.QBTMud.Helpers return sb.ToString(); } - /// /// Formats a file size in bytes into an appropriate unit based on the size. /// diff --git a/Lantean.QBTMud/Helpers/EventArgsExtensions.cs b/Lantean.QBTMud/Helpers/EventArgsExtensions.cs index 587a4aa..25ff1d2 100644 --- a/Lantean.QBTMud/Helpers/EventArgsExtensions.cs +++ b/Lantean.QBTMud/Helpers/EventArgsExtensions.cs @@ -1,6 +1,4 @@ -using System; -using Lantean.QBTMud; -using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web; namespace Lantean.QBTMud.Helpers { @@ -8,10 +6,7 @@ namespace Lantean.QBTMud.Helpers { public static EventArgs NormalizeForContextMenu(this EventArgs eventArgs) { - if (eventArgs is null) - { - throw new ArgumentNullException(nameof(eventArgs)); - } + ArgumentNullException.ThrowIfNull(eventArgs); if (eventArgs is LongPressEventArgs longPressEventArgs) { @@ -23,10 +18,7 @@ namespace Lantean.QBTMud.Helpers public static MouseEventArgs ToMouseEventArgs(this LongPressEventArgs longPressEventArgs) { - if (longPressEventArgs is null) - { - throw new ArgumentNullException(nameof(longPressEventArgs)); - } + ArgumentNullException.ThrowIfNull(longPressEventArgs); return new MouseEventArgs { @@ -41,7 +33,8 @@ namespace Lantean.QBTMud.Helpers ScreenX = longPressEventArgs.ScreenX, ScreenY = longPressEventArgs.ScreenY, Type = longPressEventArgs.Type ?? "contextmenu", + Detail = -1, }; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Helpers/FilterHelper.cs b/Lantean.QBTMud/Helpers/FilterHelper.cs index 993d92e..f2e586f 100644 --- a/Lantean.QBTMud/Helpers/FilterHelper.cs +++ b/Lantean.QBTMud/Helpers/FilterHelper.cs @@ -128,6 +128,7 @@ namespace Lantean.QBTMud.Helpers } return true; + default: if (string.IsNullOrEmpty(torrent.Category)) { diff --git a/Lantean.QBTMud/Helpers/VersionHelper.cs b/Lantean.QBTMud/Helpers/VersionHelper.cs index e4a1730..4d4a247 100644 --- a/Lantean.QBTMud/Helpers/VersionHelper.cs +++ b/Lantean.QBTMud/Helpers/VersionHelper.cs @@ -1,5 +1,4 @@ - -namespace Lantean.QBTMud.Helpers +namespace Lantean.QBTMud.Helpers { internal static class VersionHelper { @@ -31,4 +30,4 @@ namespace Lantean.QBTMud.Helpers return _version.Value; } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Layout/LoggedInLayout.razor b/Lantean.QBTMud/Layout/LoggedInLayout.razor index 44319c1..9cacd10 100644 --- a/Lantean.QBTMud/Layout/LoggedInLayout.razor +++ b/Lantean.QBTMud/Layout/LoggedInLayout.razor @@ -68,4 +68,4 @@ - + \ No newline at end of file diff --git a/Lantean.QBTMud/Layout/LoggedInLayout.razor.cs b/Lantean.QBTMud/Layout/LoggedInLayout.razor.cs index 3c57424..bf9303d 100644 --- a/Lantean.QBTMud/Layout/LoggedInLayout.razor.cs +++ b/Lantean.QBTMud/Layout/LoggedInLayout.razor.cs @@ -1,6 +1,4 @@ -using System; -using System.Linq; -using Lantean.QBitTorrentClient; +using Lantean.QBitTorrentClient; using Lantean.QBTMud.Components; using Lantean.QBTMud.Helpers; using Lantean.QBTMud.Models; @@ -272,7 +270,6 @@ namespace Lantean.QBTMud.Layout } } - protected virtual void Dispose(bool disposing) { if (!_disposedValue) @@ -294,4 +291,4 @@ namespace Lantean.QBTMud.Layout GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Models/FileRow.cs b/Lantean.QBTMud/Models/FileRow.cs index 6e39ae7..6a7d7f2 100644 --- a/Lantean.QBTMud/Models/FileRow.cs +++ b/Lantean.QBTMud/Models/FileRow.cs @@ -2,14 +2,14 @@ { public class FileRow { - public required string OriginalName { get; set; } + public string OriginalName { get; set; } public string? NewName { get; set; } public bool IsFolder { get; set; } - public required string Name { get; set; } + public string Name { get; set; } public int Level { get; set; } public bool Renamed { get; set; } public string? ErrorMessage { get; set; } - public required string Path { get; set; } + public string Path { get; set; } public override bool Equals(object? obj) { diff --git a/Lantean.QBTMud/Models/Status.cs b/Lantean.QBTMud/Models/Status.cs index 9be29be..032a42b 100644 --- a/Lantean.QBTMud/Models/Status.cs +++ b/Lantean.QBTMud/Models/Status.cs @@ -16,6 +16,5 @@ StalledDownloading, Checking, Errored, - } } \ No newline at end of file diff --git a/Lantean.QBTMud/Models/TorrentOptions.cs b/Lantean.QBTMud/Models/TorrentOptions.cs index 32d8483..0010eb7 100644 --- a/Lantean.QBTMud/Models/TorrentOptions.cs +++ b/Lantean.QBTMud/Models/TorrentOptions.cs @@ -1,6 +1,4 @@ -using Lantean.QBitTorrentClient.Models; - -namespace Lantean.QBTMud.Models +namespace Lantean.QBTMud.Models { public record TorrentOptions { diff --git a/Lantean.QBTMud/Pages/Statistics.razor b/Lantean.QBTMud/Pages/Statistics.razor index 3d90010..59a1554 100644 --- a/Lantean.QBTMud/Pages/Statistics.razor +++ b/Lantean.QBTMud/Pages/Statistics.razor @@ -59,4 +59,4 @@ @DisplayHelpers.Size(ServerState?.TotalQueuedSize) - + \ No newline at end of file diff --git a/Lantean.QBTMud/Pages/TorrentList.razor b/Lantean.QBTMud/Pages/TorrentList.razor index 47a2f43..08daee1 100644 --- a/Lantean.QBTMud/Pages/TorrentList.razor +++ b/Lantean.QBTMud/Pages/TorrentList.razor @@ -1,7 +1,7 @@ @page "/" @layout ListLayout - + View torrent details diff --git a/Lantean.QBTMud/Pages/TorrentList.razor.cs b/Lantean.QBTMud/Pages/TorrentList.razor.cs index 6b4611a..e58e41a 100644 --- a/Lantean.QBTMud/Pages/TorrentList.razor.cs +++ b/Lantean.QBTMud/Pages/TorrentList.razor.cs @@ -79,6 +79,7 @@ namespace Lantean.QBTMud.Pages private bool _pendingSelectionChange; private bool _toolbarButtonsEnabled; + protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) @@ -337,5 +338,4 @@ namespace Lantean.QBTMud.Pages } } } -} - +} \ No newline at end of file diff --git a/Lantean.QBTMud/Program.cs b/Lantean.QBTMud/Program.cs index f8064a3..55c8fdd 100644 --- a/Lantean.QBTMud/Program.cs +++ b/Lantean.QBTMud/Program.cs @@ -1,4 +1,4 @@ -using Blazored.LocalStorage; +using Blazored.LocalStorage; using Lantean.QBitTorrentClient; using Lantean.QBTMud.Services; using Microsoft.AspNetCore.Components.Web; diff --git a/Lantean.QBTMud/Services/DataManager.cs b/Lantean.QBTMud/Services/DataManager.cs index 0f2f1e9..c76e699 100644 --- a/Lantean.QBTMud/Services/DataManager.cs +++ b/Lantean.QBTMud/Services/DataManager.cs @@ -1,6 +1,5 @@ -using Lantean.QBTMud.Helpers; +using Lantean.QBTMud.Helpers; using Lantean.QBTMud.Models; -using System.Linq; namespace Lantean.QBTMud.Services { @@ -2135,4 +2134,4 @@ namespace Lantean.QBTMud.Services return new RssList(feeds, articles); } } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/Services/IDataManager.cs b/Lantean.QBTMud/Services/IDataManager.cs index e1920b6..1267f32 100644 --- a/Lantean.QBTMud/Services/IDataManager.cs +++ b/Lantean.QBTMud/Services/IDataManager.cs @@ -22,4 +22,4 @@ namespace Lantean.QBTMud.Services RssList CreateRssList(IReadOnlyDictionary rssItems); } -} +} \ No newline at end of file diff --git a/Lantean.QBTMud/wwwroot/index.html b/Lantean.QBTMud/wwwroot/index.html index 148a5a1..c984f42 100644 --- a/Lantean.QBTMud/wwwroot/index.html +++ b/Lantean.QBTMud/wwwroot/index.html @@ -37,4 +37,4 @@ - + \ No newline at end of file diff --git a/Lantean.QBTMud/wwwroot/js/longpress.js b/Lantean.QBTMud/wwwroot/js/longpress.js index b30e59e..92fca10 100644 --- a/Lantean.QBTMud/wwwroot/js/longpress.js +++ b/Lantean.QBTMud/wwwroot/js/longpress.js @@ -5,4 +5,4 @@ // * @author John Doherty // * @license MIT // */ -!function (e, t) { "use strict"; var n = null, a = "PointerEvent" in e || e.navigator && "msPointerEnabled" in e.navigator, i = "ontouchstart" in e || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, o = a ? "pointerdown" : i ? "touchstart" : "mousedown", r = a ? "pointerup" : i ? "touchend" : "mouseup", m = a ? "pointermove" : i ? "touchmove" : "mousemove", u = a ? "pointerleave" : i ? "touchleave" : "mouseleave", s = 0, c = 0, l = 10, v = 10; function f(e) { p(), e = function (e) { if (void 0 !== e.changedTouches) return e.changedTouches[0]; return e }(e), this.dispatchEvent(new CustomEvent("longpress", { bubbles: !0, cancelable: !0, detail: { clientX: e.clientX, clientY: e.clientY, offsetX: e.offsetX, offsetY: e.offsetY, pageX: e.pageX, pageY: e.pageY }, clientX: e.clientX, clientY: e.clientY, offsetX: e.offsetX, offsetY: e.offsetY, pageX: e.pageX, pageY: e.pageY, screenX: e.screenX, screenY: e.screenY })) || t.addEventListener("click", function e(n) { t.removeEventListener("click", e, !0), function (e) { e.stopImmediatePropagation(), e.preventDefault(), e.stopPropagation() }(n) }, !0) } function d(a) { p(a); var i = a.target, o = parseInt(function (e, n, a) { for (; e && e !== t.documentElement;) { var i = e.getAttribute(n); if (i) return i; e = e.parentNode } return a }(i, "data-long-press-delay", "400"), 10); n = function (t, n) { if (!(e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame && e.mozCancelRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame)) return e.setTimeout(t, n); var a = (new Date).getTime(), i = {}, o = function () { (new Date).getTime() - a >= n ? t.call() : i.value = requestAnimFrame(o) }; return i.value = requestAnimFrame(o), i }(f.bind(i, a), o) } function p(t) { var a; (a = n) && (e.cancelAnimationFrame ? e.cancelAnimationFrame(a.value) : e.webkitCancelAnimationFrame ? e.webkitCancelAnimationFrame(a.value) : e.webkitCancelRequestAnimationFrame ? e.webkitCancelRequestAnimationFrame(a.value) : e.mozCancelRequestAnimationFrame ? e.mozCancelRequestAnimationFrame(a.value) : e.oCancelRequestAnimationFrame ? e.oCancelRequestAnimationFrame(a.value) : e.msCancelRequestAnimationFrame ? e.msCancelRequestAnimationFrame(a.value) : clearTimeout(a)), n = null } "function" != typeof e.CustomEvent && (e.CustomEvent = function (e, n) { n = n || { bubbles: !1, cancelable: !1, detail: void 0 }; var a = t.createEvent("CustomEvent"); return a.initCustomEvent(e, n.bubbles, n.cancelable, n.detail), a }, e.CustomEvent.prototype = e.Event.prototype), e.requestAnimFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (t) { e.setTimeout(t, 1e3 / 60) }, t.addEventListener(r, p, !0), t.addEventListener(u, p, !0), t.addEventListener(m, function (e) { var t = Math.abs(s - e.clientX), n = Math.abs(c - e.clientY); (t >= l || n >= v) && p() }, !0), t.addEventListener("wheel", p, !0), t.addEventListener("scroll", p, !0), t.addEventListener(o, function (e) { s = e.clientX, c = e.clientY, d(e) }, !0) }(window, document); \ No newline at end of file +!function (e, t) { "use strict"; var n = null, a = "PointerEvent" in e || e.navigator && "msPointerEnabled" in e.navigator, i = "ontouchstart" in e || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, o = a ? "pointerdown" : i ? "touchstart" : "mousedown", r = a ? "pointerup" : i ? "touchend" : "mouseup", m = a ? "pointermove" : i ? "touchmove" : "mousemove", u = a ? "pointerleave" : i ? "touchleave" : "mouseleave", s = 0, c = 0, l = 10, v = 10; function f(e) { p(), e = function (e) { if (void 0 !== e.changedTouches) return e.changedTouches[0]; return e }(e); var n = new CustomEvent("longpress", { bubbles: !0, cancelable: !0, detail: { clientX: e.clientX, clientY: e.clientY, offsetX: e.offsetX, offsetY: e.offsetY, pageX: e.pageX, pageY: e.pageY }, clientX: e.clientX, clientY: e.clientY, offsetX: e.offsetX, offsetY: e.offsetY, pageX: e.pageX, pageY: e.pageY, screenX: e.screenX, screenY: e.screenY }); n.__longPress = !0, this.dispatchEvent(n) || t.addEventListener("click", function e(n) { t.removeEventListener("click", e, !0), function (e) { e.stopImmediatePropagation(), e.preventDefault(), e.stopPropagation() }(n) }, !0) } function d(a) { p(a); var i = a.target, o = parseInt(function (e, n, a) { for (; e && e !== t.documentElement;) { var i = e.getAttribute(n); if (i) return i; e = e.parentNode } return a }(i, "data-long-press-delay", "400"), 10); n = function (t, n) { if (!(e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame && e.mozCancelRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame)) return e.setTimeout(t, n); var a = (new Date).getTime(), i = {}, o = function () { (new Date).getTime() - a >= n ? t.call() : i.value = requestAnimFrame(o) }; return i.value = requestAnimFrame(o), i }(f.bind(i, a), o) } function p(t) { var a; (a = n) && (e.cancelAnimationFrame ? e.cancelAnimationFrame(a.value) : e.webkitCancelAnimationFrame ? e.webkitCancelAnimationFrame(a.value) : e.webkitCancelRequestAnimationFrame ? e.webkitCancelRequestAnimationFrame(a.value) : e.mozCancelRequestAnimationFrame ? e.mozCancelRequestAnimationFrame(a.value) : e.oCancelRequestAnimationFrame ? e.oCancelRequestAnimationFrame(a.value) : e.msCancelRequestAnimationFrame ? e.msCancelRequestAnimationFrame(a.value) : clearTimeout(a)), n = null } "function" != typeof e.CustomEvent && (e.CustomEvent = function (e, n) { n = n || { bubbles: !1, cancelable: !1, detail: void 0 }; var a = t.createEvent("CustomEvent"); return a.initCustomEvent(e, n.bubbles, n.cancelable, n.detail), a }, e.CustomEvent.prototype = e.Event.prototype), e.requestAnimFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (t) { e.setTimeout(t, 1e3 / 60) }, t.addEventListener(r, p, !0), t.addEventListener(u, p, !0), t.addEventListener(m, function (e) { var t = Math.abs(s - e.clientX), n = Math.abs(c - e.clientY); (t >= l || n >= v) && p() }, !0), t.addEventListener("wheel", p, !0), t.addEventListener("scroll", p, !0), t.addEventListener(o, function (e) { s = e.clientX, c = e.clientY, d(e) }, !0) }(window, document); \ No newline at end of file diff --git a/Lantean.QBitTorrentClient/Models/AddTorrentParams.cs b/Lantean.QBitTorrentClient/Models/AddTorrentParams.cs index 577d586..ed29a5b 100644 --- a/Lantean.QBitTorrentClient/Models/AddTorrentParams.cs +++ b/Lantean.QBitTorrentClient/Models/AddTorrentParams.cs @@ -24,13 +24,13 @@ public bool? UseDownloadPath { get; set; } public string? Category { get; set; } - + public IEnumerable? Tags { get; set; } public string? RenameTorrent { get; set; } public long? UploadLimit { get; set; } - + public long? DownloadLimit { get; set; } public float? RatioLimit { get; set; }