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
1.8 KiB
64 lines
1.8 KiB
12 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
11 years ago
|
using NzbDrone.Core.ThingiProvider;
|
||
12 years ago
|
|
||
|
namespace NzbDrone.Core.Indexers
|
||
|
{
|
||
11 years ago
|
public abstract class IndexerBase<TSettings> : IIndexer where TSettings : IProviderConfig, new()
|
||
12 years ago
|
{
|
||
11 years ago
|
public Type ConfigContract
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return typeof(TSettings);
|
||
|
}
|
||
|
}
|
||
12 years ago
|
|
||
11 years ago
|
public virtual IEnumerable<ProviderDefinition> DefaultDefinitions
|
||
12 years ago
|
{
|
||
|
get
|
||
|
{
|
||
11 years ago
|
var config = (IProviderConfig)new TSettings();
|
||
|
|
||
12 years ago
|
yield return new IndexerDefinition
|
||
|
{
|
||
11 years ago
|
Name = GetType().Name,
|
||
|
Enable = config.Validate().IsValid,
|
||
12 years ago
|
Implementation = GetType().Name,
|
||
11 years ago
|
Settings = config
|
||
12 years ago
|
};
|
||
12 years ago
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
public ProviderDefinition Definition { get; set; }
|
||
|
|
||
11 years ago
|
public abstract DownloadProtocol Protocol { get; }
|
||
11 years ago
|
|
||
|
protected TSettings Settings
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return (TSettings)Definition.Settings;
|
||
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
public virtual IParseFeed Parser { get; private set; }
|
||
12 years ago
|
|
||
|
public abstract IEnumerable<string> RecentFeed { get; }
|
||
11 years ago
|
public abstract IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber);
|
||
|
public abstract IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date);
|
||
11 years ago
|
public abstract IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int offset);
|
||
11 years ago
|
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return GetType().Name;
|
||
|
}
|
||
12 years ago
|
}
|
||
11 years ago
|
|
||
11 years ago
|
public enum DownloadProtocol
|
||
11 years ago
|
{
|
||
|
Usenet,
|
||
|
Torrent
|
||
|
}
|
||
12 years ago
|
}
|