mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Fixed: Don't re-read file tags if possible
This commit is contained in:
parent
e9ced07b28
commit
dcca2b5a1a
1 changed files with 15 additions and 12 deletions
|
@ -173,9 +173,11 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Identification
|
|||
return false;
|
||||
}
|
||||
|
||||
private List<LocalTrack> ToLocalTrack(IEnumerable<TrackFile> trackfiles)
|
||||
private List<LocalTrack> ToLocalTrack(IEnumerable<TrackFile> trackfiles, LocalAlbumRelease localRelease)
|
||||
{
|
||||
var localTracks = trackfiles.Select(x => new LocalTrack {
|
||||
var scanned = trackfiles.Join(localRelease.LocalTracks, t => t.Path, l => l.Path, (track, localTrack) => localTrack);
|
||||
var toScan = trackfiles.ExceptBy(t => t.Path, scanned, s => s.Path, StringComparer.InvariantCulture);
|
||||
var localTracks = scanned.Concat(toScan.Select(x => new LocalTrack {
|
||||
Path = x.Path,
|
||||
Size = x.Size,
|
||||
Modified = x.Modified,
|
||||
|
@ -183,7 +185,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Identification
|
|||
ExistingFile = true,
|
||||
AdditionalFile = true,
|
||||
Quality = x.Quality
|
||||
})
|
||||
}))
|
||||
.ToList();
|
||||
|
||||
localTracks.ForEach(x => _augmentingService.Augment(x, true));
|
||||
|
@ -218,7 +220,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Identification
|
|||
// convert all the TrackFiles that represent extra files to List<LocalTrack>
|
||||
var allLocalTracks = ToLocalTrack(candidateReleases
|
||||
.SelectMany(x => x.ExistingTracks)
|
||||
.DistinctBy(x => x.Path));
|
||||
.DistinctBy(x => x.Path), localAlbumRelease);
|
||||
|
||||
_logger.Debug($"Retrieved {allTracks.Count} possible tracks in {watch.ElapsedMilliseconds}ms");
|
||||
|
||||
|
@ -242,7 +244,8 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Identification
|
|||
allLocalTracks.AddRange(ToLocalTrack(newCandidates
|
||||
.SelectMany(x => x.ExistingTracks)
|
||||
.DistinctBy(x => x.Path)
|
||||
.ExceptBy(x => x.Path, allLocalTracks, x => x.Path, PathEqualityComparer.Instance)));
|
||||
.ExceptBy(x => x.Path, allLocalTracks, x => x.Path, PathEqualityComparer.Instance),
|
||||
localAlbumRelease));
|
||||
}
|
||||
|
||||
// fingerprint all the local files in candidates we might be matching against
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue