diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatAudioCodecFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatAudioCodecFixture.cs index 4fa1e6e21..e0bd875f5 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatAudioCodecFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatAudioCodecFixture.cs @@ -30,6 +30,8 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests [TestCase("TrueHD, A_TRUEHD, , ", "", "TrueHD")] [TestCase("WMA, 161, , ", "Droned.wmv", "WMA")] [TestCase("WMA, 162, Pro, ", "B.N.S04E18.720p.WEB-DL", "WMA")] + [TestCase("Opus, A_OPUS, , ", "Roadkill Ep3x11 - YouTube.webm", "Opus")] + [TestCase("mp3 , 0, , ", "climbing.mp4", "MP3")] public void should_format_audio_format(string audioFormatPack, string sceneName, string expectedFormat) { var split = audioFormatPack.Split(new string[] { ", " }, System.StringSplitOptions.None); diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatVideoCodecFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatVideoCodecFixture.cs index 14c391550..201ff11f2 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatVideoCodecFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/MediaInfoFormatterTests/FormatVideoCodecFixture.cs @@ -34,6 +34,11 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests [TestCase("V.MPEG4/ISO/AVC, V.MPEG4/ISO/AVC, , ", "pd.2015.S03E08.720p.iP.WEBRip.AAC2.0.H264-BTW", "h264")] [TestCase("WMV2, WMV2, , ", "Droned.wmv", "WMV")] [TestCase("xvid, xvid, , ", "", "XviD")] + [TestCase("div3, div3, , ", "spsm.dvdrip.divx.avi'.", "DivX")] + [TestCase("VP6, 4, , ", "Top Gear - S12E01 - Lorries - SD TV.flv", "VP6")] + [TestCase("VP7, VP70, General, ", "Sweet Seymour.avi", "VP7")] + [TestCase("VP8, V_VP8, , ", "Dick.mkv", "VP8")] + [TestCase("VP9, V_VP9, , ", "Roadkill Ep3x11 - YouTube.webm", "VP9")] public void should_format_video_format(string videoFormatPack, string sceneName, string expectedFormat) { var split = videoFormatPack.Split(new string[] { ", " }, System.StringSplitOptions.None); diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoFormatter.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoFormatter.cs index 4932dd260..30daf75d4 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoFormatter.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoFormatter.cs @@ -89,6 +89,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo return "FLAC"; } + if (audioFormat.Trim().EqualsIgnoreCase("mp3")) + { + return "MP3"; + } + if (audioFormat.EqualsIgnoreCase("MPEG Audio")) { if (mediaInfo.AudioCodecID == "55" || mediaInfo.AudioCodecID == "A_MPEG/L3" || mediaInfo.AudioProfile == "Layer 3") @@ -102,6 +107,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo } } + if (audioFormat.EqualsIgnoreCase("Opus")) + { + return "Opus"; + } + if (audioFormat.EqualsIgnoreCase("PCM")) { return "PCM"; @@ -214,7 +224,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo return GetSceneNameMatch(sceneName, "AVC", "h264"); } - if (videoFormat.EqualsIgnoreCase("DivX")) + if (videoFormat.EqualsIgnoreCase("DivX") || videoFormat.EqualsIgnoreCase("div3")) { return "DivX"; } @@ -267,6 +277,12 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo return "VC1"; } + if (videoFormat.EqualsIgnoreCase("VP6") || videoFormat.EqualsIgnoreCase("VP7") || + videoFormat.EqualsIgnoreCase("VP8") || videoFormat.EqualsIgnoreCase("VP9")) + { + return videoFormat.ToUpperInvariant(); + } + if (videoFormat == "WMV2") { return "WMV";