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