diff --git a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoImport.cs b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoImport.cs new file mode 100644 index 000000000..c4a0b4dd3 --- /dev/null +++ b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoImport.cs @@ -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 + { + 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 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); + } + } +} diff --git a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs index 08eec552b..15a6cf9cb 100644 --- a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs +++ b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs @@ -12,6 +12,7 @@ namespace NzbDrone.Core.NetImport.CouchPotato public CouchPotatoSettings() { Link = "http://localhost"; + Port = "5050"; } [FieldDefinition(0, Label = "CouchPotato URL", HelpText = "Link to your CoouchPootato.")] diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 8fe158776..6fa53c4a0 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -127,6 +127,7 @@ +