Fixed: Don't import based on track number alone.

This commit is contained in:
Qstick 2017-12-28 22:03:41 -05:00
parent 1368dd6a53
commit bc8bd9995a
1 changed files with 27 additions and 23 deletions

View File

@ -272,36 +272,40 @@ namespace NzbDrone.Core.Parser
if (trackInfo != null)
{
result.Add(trackInfo);
return result;
}
}
_logger.Debug("Track title search unsuccessful, falling back to track number for {1}", trackInfo, parsedTrackInfo);
if (parsedTrackInfo.TrackNumbers == null)
{
_logger.Debug("Track has no track numbers: {1}", trackInfo, parsedTrackInfo);
return new List<Track>();
}
foreach (var trackNumber in parsedTrackInfo.TrackNumbers)
{
Track trackInfoByNumber = null;
trackInfoByNumber = _trackService.FindTrack(artist.Id, album.Id, parsedTrackInfo.DiscNumber, trackNumber);
_logger.Debug("Track {0} selected for {1}", trackInfoByNumber, parsedTrackInfo);
if (trackInfoByNumber != null)
{
result.Add(trackInfoByNumber);
}
else
{
_logger.Debug("Unable to find {0}", parsedTrackInfo);
}
}
//_logger.Debug("Track title search unsuccessful, falling back to track number for {1}", trackInfo, parsedTrackInfo);
//if (parsedTrackInfo.TrackNumbers == null)
//{
// _logger.Debug("Track has no track numbers: {1}", trackInfo, parsedTrackInfo);
// return new List<Track>();
//}
//foreach (var trackNumber in parsedTrackInfo.TrackNumbers)
//{
// Track trackInfoByNumber = null;
// trackInfoByNumber = _trackService.FindTrack(artist.Id, album.Id, parsedTrackInfo.DiscNumber, trackNumber);
// _logger.Debug("Track {0} selected for {1}", trackInfoByNumber, parsedTrackInfo);
// if (trackInfoByNumber != null)
// {
// result.Add(trackInfoByNumber);
// }
// else
// {
// _logger.Debug("Unable to find {0}", parsedTrackInfo);
// }
//}
return result;
}
}