mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
Add CP list class.
This commit is contained in:
parent
bfcd05206f
commit
2413457323
3 changed files with 55 additions and 0 deletions
53
src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoImport.cs
Normal file
53
src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoImport.cs
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using FluentValidation.Results;
|
||||||
|
using NLog;
|
||||||
|
using NzbDrone.Common.Http;
|
||||||
|
using NzbDrone.Core.Configuration;
|
||||||
|
using NzbDrone.Core.Indexers;
|
||||||
|
using NzbDrone.Core.Indexers.PassThePopcorn;
|
||||||
|
using NzbDrone.Core.Parser;
|
||||||
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.NetImport.CouchPotato
|
||||||
|
{
|
||||||
|
public class CouchPotatoImport : HttpNetImportBase<CouchPotatoSettings>
|
||||||
|
{
|
||||||
|
public override string Name => "CouchPotato";
|
||||||
|
public override bool Enabled => true;
|
||||||
|
|
||||||
|
public CouchPotatoImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||||
|
: base(httpClient, configService, parsingService, logger)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public new virtual IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var config = (CouchPotatoSettings)new CouchPotatoSettings();
|
||||||
|
config.Link = "http://localhost";
|
||||||
|
config.Port = "5050";
|
||||||
|
|
||||||
|
yield return new NetImportDefinition
|
||||||
|
{
|
||||||
|
Name = "Localhost",
|
||||||
|
Enabled = config.Validate().IsValid && Enabled,
|
||||||
|
Implementation = GetType().Name,
|
||||||
|
Settings = config
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override INetImportRequestGenerator GetRequestGenerator()
|
||||||
|
{
|
||||||
|
return new CouchPotatoRequestGenerator() { Settings = Settings };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IParseNetImportResponse GetParser()
|
||||||
|
{
|
||||||
|
return new CouchPotatoParser(Settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,7 @@ namespace NzbDrone.Core.NetImport.CouchPotato
|
||||||
public CouchPotatoSettings()
|
public CouchPotatoSettings()
|
||||||
{
|
{
|
||||||
Link = "http://localhost";
|
Link = "http://localhost";
|
||||||
|
Port = "5050";
|
||||||
}
|
}
|
||||||
|
|
||||||
[FieldDefinition(0, Label = "CouchPotato URL", HelpText = "Link to your CoouchPootato.")]
|
[FieldDefinition(0, Label = "CouchPotato URL", HelpText = "Link to your CoouchPootato.")]
|
||||||
|
|
|
@ -127,6 +127,7 @@
|
||||||
<Compile Include="NetImport\CouchPotato\CouchPotatoParser.cs" />
|
<Compile Include="NetImport\CouchPotato\CouchPotatoParser.cs" />
|
||||||
<Compile Include="NetImport\CouchPotato\CouchPotatoRequestGenerator.cs" />
|
<Compile Include="NetImport\CouchPotato\CouchPotatoRequestGenerator.cs" />
|
||||||
<Compile Include="NetImport\CouchPotato\CouchPotatoSettings.cs" />
|
<Compile Include="NetImport\CouchPotato\CouchPotatoSettings.cs" />
|
||||||
|
<Compile Include="NetImport\CouchPotato\CouchPotatoImport.cs" />
|
||||||
<Compile Include="NetImport\Exceptions\NetImportException.cs" />
|
<Compile Include="NetImport\Exceptions\NetImportException.cs" />
|
||||||
<Compile Include="NetImport\HttpNetImportBase.cs" />
|
<Compile Include="NetImport\HttpNetImportBase.cs" />
|
||||||
<Compile Include="NetImport\NetImportFactory.cs" />
|
<Compile Include="NetImport\NetImportFactory.cs" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue