diff --git a/NzbDrone.Core/Providers/MetadataProvider.cs b/NzbDrone.Core/Providers/MetadataProvider.cs index 80c892d34..caad52dba 100644 --- a/NzbDrone.Core/Providers/MetadataProvider.cs +++ b/NzbDrone.Core/Providers/MetadataProvider.cs @@ -123,14 +123,20 @@ namespace NzbDrone.Core.Providers public virtual void CreateForEpisodeFiles(List 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); } } diff --git a/NzbDrone.Web/Controllers/HistoryController.cs b/NzbDrone.Web/Controllers/HistoryController.cs index 4aee08267..be528a0ef 100644 --- a/NzbDrone.Web/Controllers/HistoryController.cs +++ b/NzbDrone.Web/Controllers/HistoryController.cs @@ -27,34 +27,6 @@ namespace NzbDrone.Web.Controllers return View(); } - //public JsonResult AjaxBinding() - //{ - // var history = _historyProvider.AllItemsWithRelationships().Select(h => new HistoryModel - // { - // HistoryId = h.HistoryId, - // SeriesId = h.SeriesId, - // EpisodeNumbering = string.Format("{0}x{1:00}", h.Episode.SeasonNumber, h.Episode.EpisodeNumber), - // EpisodeTitle = h.Episode.Title, - // EpisodeOverview = h.Episode.Overview, - // SeriesTitle = h.SeriesTitle, - // SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle), - // NzbTitle = h.NzbTitle, - // Quality = h.Quality.ToString(), - // IsProper = h.IsProper, - // Date = h.Date.ToString(), - // DateSorter = h.Date.ToString("MM/dd/yyyy h:mm:ss tt"), - // Indexer = h.Indexer, - // EpisodeId = h.EpisodeId, - // NzbInfoUrl = h.NzbInfoUrl - // }).OrderByDescending(h => h.Date).ToList(); - - // return Json(new - // { - // aaData = history - // }, - // JsonRequestBehavior.AllowGet); - //} - public ActionResult AjaxBinding(DataTablesPageRequest pageRequest) { var pageResult = _historyProvider.GetPagedItems(pageRequest); diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index 216969c13..f7bad9ef1 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -2,8 +2,8 @@ @{ViewBag.Title = "History";} @section ActionMenu{ }