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.
Readarr/src/NzbDrone.Core/Indexers/IndexerBase.cs

65 lines
1.8 KiB

using System;
using System.Collections.Generic;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Indexers
{
public abstract class IndexerBase<TSettings> : IIndexer where TSettings : IProviderConfig, new()
{
11 years ago
public Type ConfigContract
{
get
{
return typeof(TSettings);
}
}
public virtual IEnumerable<ProviderDefinition> DefaultDefinitions
{
get
{
var config = (IProviderConfig)new TSettings();
yield return new IndexerDefinition
{
Name = GetType().Name,
Enable = config.Validate().IsValid,
Implementation = GetType().Name,
Settings = config
};
}
}
public virtual ProviderDefinition Definition { get; set; }
11 years ago
public abstract DownloadProtocol Protocol { get; }
public abstract bool SupportsPaging { get; }
protected TSettings Settings
{
get
{
return (TSettings)Definition.Settings;
}
}
public virtual IParseFeed Parser { get; private set; }
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);
11 years ago
public override string ToString()
{
return GetType().Name;
}
}
11 years ago
public enum DownloadProtocol
{
Usenet,
Torrent
}
}