mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-03 22:57:18 +02:00
Include indexer flags to show the correct custom formats in movie imported history
This commit is contained in:
parent
05c5bcbe15
commit
58e0b19d06
@ -87,9 +87,8 @@ public List<MovieHistory> GetByMovieId(int movieId, MovieHistoryEventType? event
|
||||
public QualityModel GetBestQualityInHistory(QualityProfile profile, int movieId)
|
||||
{
|
||||
var comparer = new QualityModelComparer(profile);
|
||||
return _historyRepository.GetBestQualityInHistory(movieId)
|
||||
.OrderByDescending(q => q, comparer)
|
||||
.FirstOrDefault();
|
||||
|
||||
return _historyRepository.GetBestQualityInHistory(movieId).MaxBy(q => q, comparer);
|
||||
}
|
||||
|
||||
public void UpdateMany(List<MovieHistory> toUpdate)
|
||||
@ -163,9 +162,7 @@ public void Handle(MovieGrabbedEvent message)
|
||||
history.Data.Add("ReleaseHash", message.Movie.ParsedMovieInfo.ReleaseHash);
|
||||
}
|
||||
|
||||
var torrentRelease = message.Movie.Release as TorrentInfo;
|
||||
|
||||
if (torrentRelease != null)
|
||||
if (message.Movie.Release is TorrentInfo torrentRelease)
|
||||
{
|
||||
history.Data.Add("TorrentInfoHash", torrentRelease.InfoHash);
|
||||
}
|
||||
@ -206,6 +203,7 @@ public void Handle(MovieFileImportedEvent message)
|
||||
history.Data.Add("DownloadClientName", message.DownloadClientInfo?.Name);
|
||||
history.Data.Add("ReleaseGroup", message.MovieInfo.ReleaseGroup);
|
||||
history.Data.Add("CustomFormatScore", message.MovieInfo.CustomFormatScore.ToString());
|
||||
history.Data.Add("IndexerFlags", message.ImportedMovie.IndexerFlags.ToString());
|
||||
|
||||
_historyRepository.Insert(history);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user