mirror of https://github.com/Sonarr/Sonarr
Added ParsedEpisodeInfo to LocalEpisode
This commit is contained in:
parent
98e94643fb
commit
21656ecc39
|
@ -61,9 +61,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
var destinationFilename = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
var destinationFilename = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
||||||
episodeFile = MoveFile(episodeFile, destinationFilename);
|
episodeFile = MoveFile(episodeFile, destinationFilename);
|
||||||
|
|
||||||
//TODO: This just re-parses the source path (which is how we got localEpisode to begin with)
|
_messageAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode.ParsedEpisodeInfo, localEpisode.Series));
|
||||||
var parsedEpisodeInfo = Parser.Parser.ParsePath(localEpisode.Path);
|
|
||||||
_messageAggregator.PublishEvent(new EpisodeDownloadedEvent(parsedEpisodeInfo, localEpisode.Series));
|
|
||||||
|
|
||||||
return episodeFile;
|
return episodeFile;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ namespace NzbDrone.Core.Parser.Model
|
||||||
{
|
{
|
||||||
public class LocalEpisode
|
public class LocalEpisode
|
||||||
{
|
{
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; }
|
||||||
|
|
||||||
public Series Series { get; set; }
|
public Series Series { get; set; }
|
||||||
|
|
||||||
public List<Episode> Episodes { get; set; }
|
public List<Episode> Episodes { get; set; }
|
||||||
|
@ -13,7 +17,5 @@ namespace NzbDrone.Core.Parser.Model
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
|
|
||||||
public int SeasonNumber { get { return Episodes.Select(c => c.SeasonNumber).Distinct().Single(); } }
|
public int SeasonNumber { get { return Episodes.Select(c => c.SeasonNumber).Distinct().Single(); } }
|
||||||
|
|
||||||
public string Path { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -47,7 +47,8 @@ namespace NzbDrone.Core.Parser
|
||||||
Series = series,
|
Series = series,
|
||||||
Quality = parsedEpisodeInfo.Quality,
|
Quality = parsedEpisodeInfo.Quality,
|
||||||
Episodes = episodes,
|
Episodes = episodes,
|
||||||
Path = fileName
|
Path = fileName,
|
||||||
|
ParsedEpisodeInfo = parsedEpisodeInfo
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue