1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Added ParsedEpisodeInfo to LocalEpisode

This commit is contained in:
Mark McDowall 2013-07-07 20:17:07 -07:00
parent 98e94643fb
commit 21656ecc39
3 changed files with 7 additions and 6 deletions

View File

@ -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;
}

View File

@ -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<Episode> 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; }
}
}

View File

@ -47,7 +47,8 @@ public LocalEpisode GetEpisodes(string fileName, Series series)
Series = series,
Quality = parsedEpisodeInfo.Quality,
Episodes = episodes,
Path = fileName
Path = fileName,
ParsedEpisodeInfo = parsedEpisodeInfo
};
}