mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
Fixed: Quality hierarchy not being honored during track import
This commit is contained in:
parent
91afcc36c0
commit
c4c3c4f620
2 changed files with 8 additions and 2 deletions
|
@ -131,7 +131,7 @@ namespace NzbDrone.Core.Test.MediaFiles.TrackImport.Specifications
|
|||
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(
|
||||
new TrackFile
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1)),
|
||||
Quality = new QualityModel(Quality.MP3_256, new Revision(version: 1)),
|
||||
Language = Language.English
|
||||
}))
|
||||
.Build()
|
||||
|
|
|
@ -22,11 +22,17 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Specifications
|
|||
var qualityComparer = new QualityModelComparer(localTrack.Artist.Profile);
|
||||
var languageComparer = new LanguageComparer(localTrack.Artist.LanguageProfile);
|
||||
|
||||
if (localTrack.Tracks.Any(e => e.TrackFileId != 0 && qualityComparer.Compare(e.TrackFile.Value.Quality, localTrack.Quality) > 0))
|
||||
{
|
||||
_logger.Debug("This file isn't a quality upgrade for all tracks. Skipping {0}", localTrack.Path);
|
||||
return Decision.Reject("Not an upgrade for existing track file(s)");
|
||||
}
|
||||
|
||||
if (localTrack.Tracks.Any(e => e.TrackFileId != 0 &&
|
||||
languageComparer.Compare(e.TrackFile.Value.Language, localTrack.Language) > 0 &&
|
||||
qualityComparer.Compare(e.TrackFile.Value.Quality, localTrack.Quality) == 0))
|
||||
{
|
||||
_logger.Debug("This file isn't an upgrade for all tracks. Skipping {0}", localTrack.Path);
|
||||
_logger.Debug("This file isn't a language upgrade for all tracks. Skipping {0}", localTrack.Path);
|
||||
return Decision.Reject("Not an upgrade for existing track file(s)");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue