Added additional logging to metadata creation

This commit is contained in:
Mark McDowall 2012-08-06 11:02:37 -07:00
parent 38eeda8c37
commit 510d538c86
1 changed files with 8 additions and 2 deletions

View File

@ -123,14 +123,20 @@ namespace NzbDrone.Core.Providers
public virtual void CreateForEpisodeFiles(List<EpisodeFile> episodeFiles)
{
if (episodeFiles == null || !episodeFiles.Any())
return;
{
Logger.Warn("No episode files, no metadata will be created.");
throw new ArgumentException("EpsiodeFiles must not be null or empty", "episodeFiles");
}
Logger.Trace("Creating metadata for {0} files.", episodeFiles.Count);
var tvDbSeries = _tvDbProvider.GetSeries(episodeFiles.First().SeriesId, true, true);
foreach(var episodeFile in episodeFiles)
{
foreach (var provider in _metadataProviders.Where(i => GetSettings(i.GetType()).Enable))
{
Logger.Trace("Creating {0} metadata for {1}", provider.Name, episodeFile.EpisodeFileId);
provider.CreateForEpisodeFile(episodeFile, tvDbSeries);
}
}