1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

New: Log Sentry Warn if AudioChannelPositions Error

This commit is contained in:
Qstick 2019-09-26 21:31:46 -04:00
parent 923db77751
commit ae9c2dd830
2 changed files with 21 additions and 2 deletions

View File

@ -173,5 +173,21 @@ public void should_remove_atmos_objects_from_AudioChannelPostions()
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(5.1m);
}
[Test]
public void should_warn_unknown_AudioChannelPostions()
{
var mediaInfoModel = new MediaInfoModel
{
AudioChannels = 2,
AudioChannelPositions = "3/2/0.2.1",
AudioChannelPositionsText = null,
SchemaRevision = 3
};
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(2m);
ExceptionVerification.ExpectedWarns(1);
}
}
}

View File

@ -461,9 +461,12 @@ public static string FormatVideoCodecLegacy(MediaInfoModel mediaInfo, string sce
.Sum(s => decimal.Parse(s, CultureInfo.InvariantCulture));
}
}
catch (Exception e)
catch (Exception)
{
Logger.Warn(e, "Unable to format audio channels using 'AudioChannelPositions', with a value of: '{0}'", audioChannelPositions);
Logger.Warn()
.Message("Unable to format audio channels using 'AudioChannelPositions', with a value of: '{0}'", audioChannelPositions)
.WriteSentryWarn("UnknownAudioChannelFormat", mediaInfo.AudioChannels.ToString(), mediaInfo.AudioFormat, audioChannelPositions, mediaInfo.AudioChannelPositionsText)
.Write();
}
return null;