From 21656ecc39f4c85f25776d387bf2170b2ada2130 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 7 Jul 2013 20:17:07 -0700 Subject: [PATCH] Added ParsedEpisodeInfo to LocalEpisode --- NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs | 4 +--- NzbDrone.Core/Parser/Model/LocalEpisode.cs | 6 ++++-- NzbDrone.Core/Parser/ParsingService.cs | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index 5adf3b2bd..ae925428c 100644 --- a/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -61,9 +61,7 @@ public EpisodeFile MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEp var destinationFilename = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path)); episodeFile = MoveFile(episodeFile, destinationFilename); - //TODO: This just re-parses the source path (which is how we got localEpisode to begin with) - var parsedEpisodeInfo = Parser.Parser.ParsePath(localEpisode.Path); - _messageAggregator.PublishEvent(new EpisodeDownloadedEvent(parsedEpisodeInfo, localEpisode.Series)); + _messageAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode.ParsedEpisodeInfo, localEpisode.Series)); return episodeFile; } diff --git a/NzbDrone.Core/Parser/Model/LocalEpisode.cs b/NzbDrone.Core/Parser/Model/LocalEpisode.cs index cf9bc2f75..cff8d0128 100644 --- a/NzbDrone.Core/Parser/Model/LocalEpisode.cs +++ b/NzbDrone.Core/Parser/Model/LocalEpisode.cs @@ -6,6 +6,10 @@ namespace NzbDrone.Core.Parser.Model { public class LocalEpisode { + public string Path { get; set; } + + public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; } + public Series Series { get; set; } public List Episodes { get; set; } @@ -13,7 +17,5 @@ public class LocalEpisode public QualityModel Quality { get; set; } public int SeasonNumber { get { return Episodes.Select(c => c.SeasonNumber).Distinct().Single(); } } - - public string Path { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Core/Parser/ParsingService.cs b/NzbDrone.Core/Parser/ParsingService.cs index 138efe2cc..a9ff33319 100644 --- a/NzbDrone.Core/Parser/ParsingService.cs +++ b/NzbDrone.Core/Parser/ParsingService.cs @@ -47,7 +47,8 @@ public LocalEpisode GetEpisodes(string fileName, Series series) Series = series, Quality = parsedEpisodeInfo.Quality, Episodes = episodes, - Path = fileName + Path = fileName, + ParsedEpisodeInfo = parsedEpisodeInfo }; }