Fix MaxRatio to allow float values

This commit is contained in:
Eric Haughee
2025-09-20 18:29:18 -07:00
parent 1cf9f97187
commit bb90ce5216
5 changed files with 12 additions and 8 deletions

View File

@@ -92,7 +92,9 @@
<FieldSwitch Label="When ratio reaches" Value="MaxRatioEnabled" ValueChanged="MaxRatioEnabledChanged" />
</MudItem>
<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 xs="3">
<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 SlowTorrentInactiveTimer { 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 int MaxSeedingTime { get; private set; }
protected int MaxRatioAct { get; private set; }
@@ -275,7 +275,7 @@
await PreferencesChanged.InvokeAsync(UpdatePreferences);
}
protected async Task MaxRatioChanged(int value)
protected async Task MaxRatioChanged(float value)
{
MaxRatio = value;
UpdatePreferences.MaxRatio = value;

View File

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

View File

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

View File

@@ -68,11 +68,13 @@ cd qbtmud
dotnet restore
```
### 3. Build the Application
### 3. Build and Publish the Application
```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
Follow the same steps as in the **Installation** section to set qbtmud as your WebUI.