mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Fixed: Ensure Quality is always initialised in AudioTag.Read (#694)
* Fixed: Ensure Quality is always initialised in AudioTag.Read * Fixed: Log quality message on fallback quality detection
This commit is contained in:
parent
f50b60103c
commit
b557f620d9
1 changed files with 28 additions and 24 deletions
|
@ -200,16 +200,20 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
// Log as error so it goes to sentry with correct fingerprint
|
// Log as error so it goes to sentry with correct fingerprint
|
||||||
Logger.Error(ex, "Tag reading failed for {0}", path);
|
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
|
finally
|
||||||
{
|
{
|
||||||
file?.Dispose();
|
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)
|
private int EstimateBitrate(TagLib.File file, string path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue