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