You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.2 KiB
64 lines
2.2 KiB
using System.Collections.Generic;
|
|
using NLog;
|
|
using NzbDrone.Common.Http;
|
|
using NzbDrone.Core.Configuration;
|
|
using NzbDrone.Core.Parser;
|
|
using NzbDrone.Core.ThingiProvider;
|
|
|
|
namespace NzbDrone.Core.ImportLists.RSSImport
|
|
{
|
|
public class RSSImport : HttpImportListBase<RSSImportSettings>
|
|
{
|
|
public override string Name => "RSS List";
|
|
|
|
public override ImportListSource ListType => ImportListSource.Advanced;
|
|
public override bool Enabled => true;
|
|
public override ImportListType EnableAuto => ImportListType.Manual;
|
|
|
|
public RSSImport(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
|
: base(httpClient, importListStatusService, configService, parsingService, logger)
|
|
{
|
|
}
|
|
|
|
public override IEnumerable<ProviderDefinition> DefaultDefinitions
|
|
{
|
|
get
|
|
{
|
|
foreach (var def in base.DefaultDefinitions)
|
|
{
|
|
yield return def;
|
|
}
|
|
|
|
yield return new ImportListDefinition
|
|
{
|
|
Name = "IMDb List",
|
|
Enabled = Enabled,
|
|
EnableAuto = ImportListType.Automatic,
|
|
ProfileId = 1,
|
|
Implementation = GetType().Name,
|
|
Settings = new RSSImportSettings { Link = "https://rss.imdb.com/list/YOURLISTID" },
|
|
};
|
|
yield return new ImportListDefinition
|
|
{
|
|
Name = "IMDb Watchlist",
|
|
Enabled = Enabled,
|
|
EnableAuto = ImportListType.Automatic,
|
|
ProfileId = 1,
|
|
Implementation = GetType().Name,
|
|
Settings = new RSSImportSettings { Link = "https://rss.imdb.com/user/IMDBUSERID/watchlist" },
|
|
};
|
|
}
|
|
}
|
|
|
|
public override IImportListRequestGenerator GetRequestGenerator()
|
|
{
|
|
return new RSSImportRequestGenerator() { Settings = Settings };
|
|
}
|
|
|
|
public override IParseImportListResponse GetParser()
|
|
{
|
|
return new RSSImportParser(Settings, _logger);
|
|
}
|
|
}
|
|
}
|