mirror of
https://github.com/Radarr/Radarr
synced 2024-12-21 23:42:23 +00: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
a2b38c5b7d
commit
6ac9cca953
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
using System.Text.Json.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentValidation;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
@ -27,6 +28,7 @@ public class TransmissionSettings : DownloadClientSettingsBase<TransmissionSetti
|
|||
{
|
||||
private static readonly TransmissionSettingsValidator Validator = new ();
|
||||
|
||||
// This constructor is used when creating a new instance, such as the user adding a new Transmission client.
|
||||
public TransmissionSettings()
|
||||
{
|
||||
Host = "localhost";
|
||||
|
@ -35,6 +37,18 @@ public TransmissionSettings()
|
|||
MovieCategory = "radarr";
|
||||
}
|
||||
|
||||
// TODO: Remove this in v6
|
||||
// This constructor is used when deserializing from JSON, it will set the
|
||||
// category to the deserialized value, defaulting to null.
|
||||
[JsonConstructor]
|
||||
public TransmissionSettings(string movieCategory = null)
|
||||
{
|
||||
Host = "localhost";
|
||||
Port = 9091;
|
||||
UrlBase = "/transmission/";
|
||||
MovieCategory = movieCategory;
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]
|
||||
public string Host { get; set; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue