Merge pull request #8 from ehaughee/develop

Fix MaxRatio to allow float values
This commit is contained in:
ahjephson
2025-10-02 15:01:10 +01:00
committed by GitHub
5 changed files with 12 additions and 8 deletions

View File

@@ -92,7 +92,9 @@
<FieldSwitch Label="When ratio reaches" Value="MaxRatioEnabled" ValueChanged="MaxRatioEnabledChanged" /> <FieldSwitch Label="When ratio reaches" Value="MaxRatioEnabled" ValueChanged="MaxRatioEnabledChanged" />
</MudItem> </MudItem>
<MudItem xs="9"> <MudItem xs="9">
<MudNumericField T="int" Label="" Value="MaxRatio" ValueChanged="MaxRatioChanged" Disabled="@(!MaxRatioEnabled)" Min="0" Max="9998" Variant="Variant.Outlined" Validation="MaxRatioValidation" /> <MudNumericField T="float" Label="" Value="MaxRatio" ValueChanged="MaxRatioChanged"
Disabled="@(!MaxRatioEnabled)" Min="0" Max="9998" Variant="Variant.Outlined"
Validation="MaxRatioValidation" />
</MudItem> </MudItem>
<MudItem xs="3"> <MudItem xs="3">
<FieldSwitch Label="When total seeding time reaches" Value="MaxSeedingTimeEnabled" ValueChanged="MaxSeedingTimeEnabledChanged" /> <FieldSwitch Label="When total seeding time reaches" Value="MaxSeedingTimeEnabled" ValueChanged="MaxSeedingTimeEnabledChanged" />

View File

@@ -17,7 +17,7 @@
protected int SlowTorrentUlRateThreshold { get; private set; } protected int SlowTorrentUlRateThreshold { get; private set; }
protected int SlowTorrentInactiveTimer { get; private set; } protected int SlowTorrentInactiveTimer { get; private set; }
protected bool MaxRatioEnabled { get; private set; } protected bool MaxRatioEnabled { get; private set; }
protected int MaxRatio { get; private set; } protected float MaxRatio { get; private set; }
protected bool MaxSeedingTimeEnabled { get; private set; } protected bool MaxSeedingTimeEnabled { get; private set; }
protected int MaxSeedingTime { get; private set; } protected int MaxSeedingTime { get; private set; }
protected int MaxRatioAct { get; private set; } protected int MaxRatioAct { get; private set; }
@@ -275,7 +275,7 @@
await PreferencesChanged.InvokeAsync(UpdatePreferences); await PreferencesChanged.InvokeAsync(UpdatePreferences);
} }
protected async Task MaxRatioChanged(int value) protected async Task MaxRatioChanged(float value)
{ {
MaxRatio = value; MaxRatio = value;
UpdatePreferences.MaxRatio = value; UpdatePreferences.MaxRatio = value;

View File

@@ -112,7 +112,7 @@ namespace Lantean.QBitTorrentClient.Models
int maxConnecPerTorrent, int maxConnecPerTorrent,
int maxInactiveSeedingTime, int maxInactiveSeedingTime,
bool maxInactiveSeedingTimeEnabled, bool maxInactiveSeedingTimeEnabled,
int maxRatio, float maxRatio,
int maxRatioAct, int maxRatioAct,
bool maxRatioEnabled, bool maxRatioEnabled,
int maxSeedingTime, int maxSeedingTime,
@@ -745,7 +745,7 @@ namespace Lantean.QBitTorrentClient.Models
public bool MaxInactiveSeedingTimeEnabled { get; } public bool MaxInactiveSeedingTimeEnabled { get; }
[JsonPropertyName("max_ratio")] [JsonPropertyName("max_ratio")]
public int MaxRatio { get; } public float MaxRatio { get; }
[JsonPropertyName("max_ratio_act")] [JsonPropertyName("max_ratio_act")]
public int MaxRatioAct { get; } public int MaxRatioAct { get; }

View File

@@ -323,7 +323,7 @@ namespace Lantean.QBitTorrentClient.Models
public bool? MaxInactiveSeedingTimeEnabled { get; set; } public bool? MaxInactiveSeedingTimeEnabled { get; set; }
[JsonPropertyName("max_ratio")] [JsonPropertyName("max_ratio")]
public int? MaxRatio { get; set; } public float? MaxRatio { get; set; }
[JsonPropertyName("max_ratio_act")] [JsonPropertyName("max_ratio_act")]
public int? MaxRatioAct { get; set; } public int? MaxRatioAct { get; set; }

View File

@@ -68,11 +68,13 @@ cd qbtmud
dotnet restore dotnet restore
``` ```
### 3. Build the Application ### 3. Build and Publish the Application
```sh ```sh
dotnet build --configuration Release dotnet publish --configuration Release
``` ```
This will output the Web UI files to `Lantean.QBTMud\bin\Release\net9.0\publish\wwwroot`.
### 4. Configure qBittorrent to Use qbtmud ### 4. Configure qBittorrent to Use qbtmud
Follow the same steps as in the **Installation** section to set qbtmud as your WebUI. Follow the same steps as in the **Installation** section to set qbtmud as your WebUI.