Fixed: (Hopefully) Bug where movie file was not correctly linked to movie.

pull/1870/head
Leonardo Galli 7 years ago
parent 3fb356ddb6
commit 67dd498576

@ -151,7 +151,7 @@ namespace NzbDrone.Core.MediaFiles
{
_logger.Error("Movie is null for the file {0}. Please run the houskeeping command to ensure movies and files are linked correctly.");
}
_movieService.SetFileId(addedFile.Movie.Value, addedFile); //Should not be necessary, but sometimes below fails?
//_movieService.SetFileId(addedFile.Movie.Value, addedFile); //Should not be necessary, but sometimes below fails?
_eventAggregator.PublishEvent(new MovieFileAddedEvent(addedFile));
return addedFile;

@ -359,7 +359,10 @@ namespace NzbDrone.Core.Tv
public void Handle(MovieFileAddedEvent message)
{
_movieRepository.SetFileId(message.MovieFile.Id, message.MovieFile.Movie.Value.Id);
var movie = message.MovieFile.Movie.Value;
movie.MovieFileId = message.MovieFile.Id;
_movieRepository.Update(movie);
//_movieRepository.SetFileId(message.MovieFile.Id, message.MovieFile.Movie.Value.Id);
_logger.Info("Linking [{0}] > [{1}]", message.MovieFile.RelativePath, message.MovieFile.Movie.Value);
}

Loading…
Cancel
Save