Radarr/NzbDrone.Core/Providers/Metadata/MetadataBase.cs

66 lines
2.5 KiB
C#
Raw Normal View History

2012-07-07 23:52:04 +00:00
using System;
using NLog;
2012-07-10 04:37:24 +00:00
using NzbDrone.Common;
2012-07-07 23:52:04 +00:00
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
2012-07-10 04:37:24 +00:00
using TvdbLib.Data;
2012-07-07 23:52:04 +00:00
namespace NzbDrone.Core.Providers.Metadata
{
public abstract class MetadataBase
{
protected readonly Logger _logger;
protected readonly ConfigProvider _configProvider;
2012-07-10 04:37:24 +00:00
protected readonly DiskProvider _diskProvider;
protected readonly BannerProvider _bannerProvider;
protected readonly EpisodeProvider _episodeProvider;
2012-07-07 23:52:04 +00:00
2012-07-10 04:37:24 +00:00
protected MetadataBase(ConfigProvider configProvider, DiskProvider diskProvider,
BannerProvider bannerProvider, EpisodeProvider episodeProvider)
2012-07-07 23:52:04 +00:00
{
_configProvider = configProvider;
2012-07-10 04:37:24 +00:00
_diskProvider = diskProvider;
_bannerProvider = bannerProvider;
_episodeProvider = episodeProvider;
2012-07-07 23:52:04 +00:00
_logger = LogManager.GetLogger(GetType().ToString());
}
/// <summary>
2012-07-10 04:37:24 +00:00
/// Gets the name for the metabase provider
2012-07-07 23:52:04 +00:00
/// </summary>
public abstract string Name { get; }
/// <summary>
2012-07-10 04:37:24 +00:00
/// Creates metadata for a series
2012-07-07 23:52:04 +00:00
/// </summary>
2012-07-10 04:37:24 +00:00
/// <param name = "series">The series to create the metadata for</param>
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
public abstract void CreateForSeries(Series series, TvdbSeries tvDbSeries);
2012-07-07 23:52:04 +00:00
/// <summary>
2012-07-10 04:37:24 +00:00
/// Creates metadata for the episode file
2012-07-07 23:52:04 +00:00
/// </summary>
2012-07-10 04:37:24 +00:00
/// <param name = "episodeFile">The episode file to create the metadata</param>
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
public abstract void CreateForEpisodeFile(EpisodeFile episodeFile, TvdbSeries tvDbSeries);
/// <summary>
/// Removes metadata for a series
/// </summary>
/// <param name = "series">The series to create the metadata for</param>
public abstract void RemoveForSeries(Series series);
/// <summary>
/// Removes metadata for the episode file
/// </summary>
/// <param name = "episodeFile">The episode file to create the metadata</param>
public abstract void RemoveForEpisodeFile(EpisodeFile episodeFile);
2012-07-07 23:52:04 +00:00
2012-07-10 04:37:24 +00:00
public virtual string GetEpisodeGuideUrl(int seriesId)
{
return String.Format("http://www.thetvdb.com/api/{0}/series/{1}/all/en.zip", TvDbProvider.TVDB_APIKEY, seriesId);
}
2012-07-07 23:52:04 +00:00
}
}