mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Fallback to 'VideoCodec' if 'VideoFormat' is unavailable (#3142)
This commit is contained in:
parent
e62b6d1ddb
commit
5d0effa591
@ -8,10 +8,10 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class FormatVideoCodecFixture : TestBase
|
public class FormatVideoCodecFixture : TestBase
|
||||||
{
|
{
|
||||||
[TestCase("AVC", null, "h264")]
|
[TestCase("AVC", null, "x264")]
|
||||||
[TestCase("AVC", "source.title.x264.720p-Sonarr", "x264")]
|
[TestCase("AVC", "source.title.x264.720p-Sonarr", "x264")]
|
||||||
[TestCase("AVC", "source.title.h264.720p-Sonarr", "h264")]
|
[TestCase("AVC", "source.title.h264.720p-Sonarr", "h264")]
|
||||||
[TestCase("V_MPEGH/ISO/HEVC", null, "h265")]
|
[TestCase("V_MPEGH/ISO/HEVC", null, "x265")]
|
||||||
[TestCase("V_MPEGH/ISO/HEVC", "source.title.x265.720p-Sonarr", "x265")]
|
[TestCase("V_MPEGH/ISO/HEVC", "source.title.x265.720p-Sonarr", "x265")]
|
||||||
[TestCase("V_MPEGH/ISO/HEVC", "source.title.h265.720p-Sonarr", "h265")]
|
[TestCase("V_MPEGH/ISO/HEVC", "source.title.h265.720p-Sonarr", "h265")]
|
||||||
[TestCase("MPEG-2 Video", null, "MPEG2")]
|
[TestCase("MPEG-2 Video", null, "MPEG2")]
|
||||||
@ -19,7 +19,7 @@ public void should_format_video_codec_with_source_title_legacy(string videoCodec
|
|||||||
{
|
{
|
||||||
var mediaInfoModel = new MediaInfoModel
|
var mediaInfoModel = new MediaInfoModel
|
||||||
{
|
{
|
||||||
VideoFormat = videoCodec
|
VideoCodec = videoCodec
|
||||||
};
|
};
|
||||||
|
|
||||||
MediaInfoFormatter.FormatVideoCodec(mediaInfoModel, sceneName).Should().Be(expectedFormat);
|
MediaInfoFormatter.FormatVideoCodec(mediaInfoModel, sceneName).Should().Be(expectedFormat);
|
||||||
|
@ -331,7 +331,7 @@ public static string FormatVideoCodec(MediaInfoModel mediaInfo, string sceneName
|
|||||||
|
|
||||||
public static string FormatVideoCodecLegacy(MediaInfoModel mediaInfo, string sceneName)
|
public static string FormatVideoCodecLegacy(MediaInfoModel mediaInfo, string sceneName)
|
||||||
{
|
{
|
||||||
var videoCodec = mediaInfo.VideoFormat;
|
var videoCodec = mediaInfo.VideoCodec;
|
||||||
|
|
||||||
if (videoCodec.IsNullOrWhiteSpace())
|
if (videoCodec.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
|
|||||||
public class MediaInfoModel : IEmbeddedDocument
|
public class MediaInfoModel : IEmbeddedDocument
|
||||||
{
|
{
|
||||||
public string ContainerFormat { get; set; }
|
public string ContainerFormat { get; set; }
|
||||||
|
public string VideoCodec { get; set; }
|
||||||
public string VideoFormat { get; set; }
|
public string VideoFormat { get; set; }
|
||||||
public string VideoCodecID { get; set; }
|
public string VideoCodecID { get; set; }
|
||||||
public string VideoProfile { get; set; }
|
public string VideoProfile { get; set; }
|
||||||
|
@ -17,8 +17,8 @@ public class VideoFileInfoReader : IVideoFileInfoReader
|
|||||||
private readonly IDiskProvider _diskProvider;
|
private readonly IDiskProvider _diskProvider;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public const int MINIMUM_MEDIA_INFO_SCHEMA_REVISION = 3;
|
public const int MINIMUM_MEDIA_INFO_SCHEMA_REVISION = 4;
|
||||||
public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 4;
|
public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 5;
|
||||||
|
|
||||||
public VideoFileInfoReader(IDiskProvider diskProvider, Logger logger)
|
public VideoFileInfoReader(IDiskProvider diskProvider, Logger logger)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ module.exports = NzbDroneCell.extend({
|
|||||||
if (runtime) {
|
if (runtime) {
|
||||||
runtime = runtime.split(".")[0];
|
runtime = runtime.split(".")[0];
|
||||||
}
|
}
|
||||||
var video = "{0} ({1}x{2}) ({3})".format(info.videoFormat, info.width, info.height, runtime);
|
var video = "{0} ({1}x{2}) ({3})".format(info.videoFormat || info.videoCodec, info.width, info.height, runtime);
|
||||||
var audio = "{0} ({1})".format(info.audioFormat, info.audioLanguages);
|
var audio = "{0} ({1})".format(info.audioFormat, info.audioLanguages);
|
||||||
this.$el.html(video + " " + audio);
|
this.$el.html(video + " " + audio);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user