2012-07-08 01:52:04 +02:00
|
|
|
|
using System;
|
|
|
|
|
using NLog;
|
2012-07-10 06:37:24 +02:00
|
|
|
|
using NzbDrone.Common;
|
2012-07-08 01:52:04 +02:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
using NzbDrone.Core.Repository;
|
2012-10-17 02:08:47 +02:00
|
|
|
|
using TvdbLib.Data;
|
2012-07-08 01:52:04 +02:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Metadata
|
|
|
|
|
{
|
|
|
|
|
public abstract class MetadataBase
|
|
|
|
|
{
|
|
|
|
|
protected readonly Logger _logger;
|
|
|
|
|
protected readonly ConfigProvider _configProvider;
|
2012-07-10 06:37:24 +02:00
|
|
|
|
protected readonly DiskProvider _diskProvider;
|
|
|
|
|
protected readonly BannerProvider _bannerProvider;
|
|
|
|
|
protected readonly EpisodeProvider _episodeProvider;
|
2012-07-08 01:52:04 +02:00
|
|
|
|
|
2012-07-10 06:37:24 +02:00
|
|
|
|
protected MetadataBase(ConfigProvider configProvider, DiskProvider diskProvider,
|
|
|
|
|
BannerProvider bannerProvider, EpisodeProvider episodeProvider)
|
2012-07-08 01:52:04 +02:00
|
|
|
|
{
|
|
|
|
|
_configProvider = configProvider;
|
2012-07-10 06:37:24 +02:00
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
|
_bannerProvider = bannerProvider;
|
|
|
|
|
_episodeProvider = episodeProvider;
|
2012-07-08 01:52:04 +02:00
|
|
|
|
_logger = LogManager.GetLogger(GetType().ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 06:37:24 +02:00
|
|
|
|
/// Gets the name for the metabase provider
|
2012-07-08 01:52:04 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract string Name { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 06:37:24 +02:00
|
|
|
|
/// Creates metadata for a series
|
2012-07-08 01:52:04 +02:00
|
|
|
|
/// </summary>
|
2012-07-10 06:37:24 +02:00
|
|
|
|
/// <param name = "series">The series to create the metadata for</param>
|
|
|
|
|
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
|
2012-07-12 23:08:21 +02:00
|
|
|
|
public abstract void CreateForSeries(Series series, TvdbSeries tvDbSeries);
|
2012-07-08 01:52:04 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 06:37:24 +02:00
|
|
|
|
/// Creates metadata for the episode file
|
2012-07-08 01:52:04 +02:00
|
|
|
|
/// </summary>
|
2012-07-10 06:37:24 +02:00
|
|
|
|
/// <param name = "episodeFile">The episode file to create the metadata</param>
|
|
|
|
|
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
|
2012-07-12 23:08:21 +02:00
|
|
|
|
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-08 01:52:04 +02:00
|
|
|
|
|
2012-07-10 06:37:24 +02: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-08 01:52:04 +02:00
|
|
|
|
}
|
|
|
|
|
}
|