mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
Added Qualties to Settings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using FluentValidation.Results;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
@@ -15,9 +16,9 @@ namespace NzbDrone.Core.NetImport.IMDbWatchList
|
||||
{
|
||||
public override string Name => "IMDbWatchList";
|
||||
public override string Link => "http://rss.imdb.com/list/";
|
||||
public override int ProfileId => 1;
|
||||
public override bool Enabled => true;
|
||||
|
||||
|
||||
public IMDbWatchList(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
: base(httpClient, configService, parsingService, logger)
|
||||
{ }
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace NzbDrone.Core.NetImport.IMDbWatchList
|
||||
{
|
||||
Title = title.MovieTitle,
|
||||
Year = title.Year,
|
||||
ProfileId = _settings.ProfileId,
|
||||
ImdbId = Parser.Parser.ParseImdbId(result.Link)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Profiles;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
@@ -20,10 +21,14 @@ namespace NzbDrone.Core.NetImport.IMDbWatchList
|
||||
public IMDbWatchListSettings()
|
||||
{
|
||||
Link = "http://rss.imdb.com/list/";
|
||||
ProfileId = 1;
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Watch List RSS link", HelpLink = "http://rss.imdb.com/list/")]
|
||||
public string Link { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Quality", Type = FieldType.Select, SelectOptions = typeof(Profile), HelpText = "Quality of all imported movies")]
|
||||
public int ProfileId { get; set; }
|
||||
|
||||
public bool IsValid => !string.IsNullOrWhiteSpace(Link);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace NzbDrone.Core.NetImport
|
||||
|
||||
public abstract string Name { get; }
|
||||
public abstract string Link { get; }
|
||||
public abstract int ProfileId { get; }
|
||||
|
||||
public abstract bool Enabled { get; }
|
||||
|
||||
@@ -46,6 +47,7 @@ namespace NzbDrone.Core.NetImport
|
||||
{
|
||||
Name = GetType().Name,
|
||||
Link = Link,
|
||||
ProfileId = ProfileId,
|
||||
Enabled = config.Validate().IsValid && Enabled,
|
||||
Implementation = GetType().Name,
|
||||
Settings = config
|
||||
|
||||
@@ -4,8 +4,9 @@ namespace NzbDrone.Core.NetImport
|
||||
{
|
||||
public class NetImportDefinition : ProviderDefinition
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string Link { get; set; }
|
||||
public int ProfileId { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public override bool Enable => Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user