mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 18:17:13 +00:00
moveepisode is less side-effecty!
This commit is contained in:
parent
954a79639f
commit
c25b92955f
1 changed files with 3 additions and 5 deletions
|
@ -34,14 +34,12 @@ private void RenameFiles(List<EpisodeFile> episodeFiles, Series series)
|
||||||
{
|
{
|
||||||
var renamed = new List<EpisodeFile>();
|
var renamed = new List<EpisodeFile>();
|
||||||
|
|
||||||
foreach (var file in episodeFiles)
|
foreach (var episodeFile in episodeFiles)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var episodeFile = file;
|
|
||||||
|
|
||||||
_logger.Trace("Renaming episode file: {0}", episodeFile);
|
_logger.Trace("Renaming episode file: {0}", episodeFile);
|
||||||
episodeFile = _episodeFileMover.MoveEpisodeFile(episodeFile, series);
|
episodeFile.Path = _episodeFileMover.MoveEpisodeFile(episodeFile, series);
|
||||||
|
|
||||||
_mediaFileService.Update(episodeFile);
|
_mediaFileService.Update(episodeFile);
|
||||||
renamed.Add(episodeFile);
|
renamed.Add(episodeFile);
|
||||||
|
@ -54,7 +52,7 @@ private void RenameFiles(List<EpisodeFile> episodeFiles, Series series)
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Failed to rename file: " + file.Path, ex);
|
_logger.ErrorException("Failed to rename file: " + episodeFile.Path, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue