mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Avoid default category on existing Transmission configurations
Co-authored-by: Mark McDowall <mark@mcdowall.ca> (cherry picked from commit bd656ae7f66fc9224ef2a57857152ee5d54d54f8)
This commit is contained in:
parent
060a0cbacb
commit
830b16778e
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
@ -28,6 +29,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||||
{
|
{
|
||||||
private static readonly TransmissionSettingsValidator Validator = new TransmissionSettingsValidator();
|
private static readonly TransmissionSettingsValidator Validator = new TransmissionSettingsValidator();
|
||||||
|
|
||||||
|
// This constructor is used when creating a new instance, such as the user adding a new Transmission client.
|
||||||
public TransmissionSettings()
|
public TransmissionSettings()
|
||||||
{
|
{
|
||||||
Host = "localhost";
|
Host = "localhost";
|
||||||
|
@ -36,6 +38,18 @@ namespace NzbDrone.Core.Download.Clients.Transmission
|
||||||
MusicCategory = "lidarr";
|
MusicCategory = "lidarr";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove this in v3
|
||||||
|
// This constructor is used when deserializing from JSON, it will set the
|
||||||
|
// category to the deserialized value, defaulting to null.
|
||||||
|
[JsonConstructor]
|
||||||
|
public TransmissionSettings(string musicCategory = null)
|
||||||
|
{
|
||||||
|
Host = "localhost";
|
||||||
|
Port = 9091;
|
||||||
|
UrlBase = "/transmission/";
|
||||||
|
MusicCategory = musicCategory;
|
||||||
|
}
|
||||||
|
|
||||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue