mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
Added Qualties to Settings
This commit is contained in:
parent
6878abe2a2
commit
b02944a3b2
7 changed files with 20 additions and 7 deletions
|
@ -9,10 +9,11 @@ namespace NzbDrone.Core.Datastore.Migration
|
|||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Create.TableForModel("NetImport")
|
||||
.WithColumn("Enabled").AsBoolean()
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Implementation").AsString()
|
||||
.WithColumn("Settings").AsString().Nullable();
|
||||
.WithColumn("Enabled").AsBoolean()
|
||||
.WithColumn("ProfileId").AsInt32()
|
||||
.WithColumn("Name").AsString().Unique()
|
||||
.WithColumn("Implementation").AsString()
|
||||
.WithColumn("Settings").AsString().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,11 +21,15 @@ 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);
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1273,7 +1273,9 @@
|
|||
</Content>
|
||||
<Compile Include="Notifications\Telegram\TelegramError.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="NetImport\CouchPotato\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue