Radarr/NzbDrone.Core/Indexers/IndexerBase.cs

62 lines
1.7 KiB
C#
Raw Normal View History

2013-04-07 07:30:37 +00:00
using System;
using System.Collections.Generic;
using NzbDrone.Core.ThingiProvider;
2013-04-07 07:30:37 +00:00
namespace NzbDrone.Core.Indexers
{
2013-09-22 05:20:26 +00:00
public abstract class IndexerBase<TSettings> : IIndexer
2013-04-07 07:30:37 +00:00
{
2013-09-22 20:00:29 +00:00
public Type ConfigContract
{
get
{
return typeof(TSettings);
}
}
2013-04-07 07:30:37 +00:00
2013-09-22 05:20:26 +00:00
public virtual IEnumerable<ProviderDefinition> DefaultDefinitions
2013-04-07 07:30:37 +00:00
{
get
{
yield return new IndexerDefinition
{
2013-09-22 20:00:29 +00:00
Name = this.GetType().Name,
2013-09-22 05:20:26 +00:00
Enable = false,
Implementation = GetType().Name,
2013-09-22 20:00:29 +00:00
Settings = NullConfig.Instance
};
2013-04-07 07:30:37 +00:00
}
}
2013-09-22 05:20:26 +00:00
public ProviderDefinition Definition { get; set; }
2013-09-22 20:00:29 +00:00
public abstract DownloadProtocol Protocol { get; }
2013-09-22 05:20:26 +00:00
protected TSettings Settings
{
get
{
return (TSettings)Definition.Settings;
}
}
2013-09-13 23:17:58 +00:00
public virtual IParseFeed Parser { get; private set; }
2013-04-07 07:30:37 +00:00
public abstract IEnumerable<string> RecentFeed { get; }
public abstract IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber);
public abstract IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date);
public abstract IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int offset);
2013-09-22 20:00:29 +00:00
public override string ToString()
{
return GetType().Name;
}
2013-04-07 07:30:37 +00:00
}
2013-09-22 20:00:29 +00:00
public enum DownloadProtocol
{
Usenet,
Torrent
}
2013-04-07 07:30:37 +00:00
}