|
|
|
@ -200,16 +200,20 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
// Log as error so it goes to sentry with correct fingerprint
|
|
|
|
|
Logger.Error(ex, "Tag reading failed for {0}", path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make sure these are initialized to avoid errors later on
|
|
|
|
|
Quality = QualityParser.ParseQuality(path, null, EstimateBitrate(file, path));
|
|
|
|
|
Logger.Debug($"Quality parsed: {Quality}, Source: {Quality.QualityDetectionSource}");
|
|
|
|
|
MediaInfo = new MediaInfoModel();
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
file?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make sure these are initialized to avoid errors later on
|
|
|
|
|
if (Quality == null)
|
|
|
|
|
{
|
|
|
|
|
Quality = QualityParser.ParseQuality(path, null, EstimateBitrate(file, path));
|
|
|
|
|
Logger.Debug($"Unable to parse qulity from tag, Quality parsed from file path: {Quality}, Source: {Quality.QualityDetectionSource}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MediaInfo = MediaInfo ?? new MediaInfoModel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int EstimateBitrate(TagLib.File file, string path)
|
|
|
|
|