New: Added Mediainfo Video Dynamic Range column for episodes

Closes #4963
This commit is contained in:
Mark McDowall 2022-04-24 13:18:48 -07:00
parent 893a6744ac
commit ae0e23fc8e
6 changed files with 37 additions and 2 deletions

View File

@ -32,7 +32,8 @@ function MediaInfo(props) {
audioCodec, audioCodec,
audioLanguages, audioLanguages,
subtitles, subtitles,
videoCodec videoCodec,
videoDynamicRangeType
} = props; } = props;
if (type === mediaInfoTypes.AUDIO) { if (type === mediaInfoTypes.AUDIO) {
@ -72,6 +73,14 @@ function MediaInfo(props) {
); );
} }
if (type === mediaInfoTypes.VIDEO_DYNAMIC_RANGE_TYPE) {
return (
<span>
{videoDynamicRangeType}
</span>
);
}
return null; return null;
} }
@ -81,7 +90,8 @@ MediaInfo.propTypes = {
audioCodec: PropTypes.string, audioCodec: PropTypes.string,
audioLanguages: PropTypes.string, audioLanguages: PropTypes.string,
subtitles: PropTypes.string, subtitles: PropTypes.string,
videoCodec: PropTypes.string videoCodec: PropTypes.string,
videoDynamicRangeType: PropTypes.string
}; };
export default MediaInfo; export default MediaInfo;

View File

@ -2,3 +2,4 @@ export const AUDIO = 'audio';
export const AUDIO_LANGUAGES = 'audioLanguages'; export const AUDIO_LANGUAGES = 'audioLanguages';
export const SUBTITLES = 'subtitles'; export const SUBTITLES = 'subtitles';
export const VIDEO = 'video'; export const VIDEO = 'video';
export const VIDEO_DYNAMIC_RANGE_TYPE = 'videoDynamicRangeType';

View File

@ -38,6 +38,7 @@
} }
.audioLanguages, .audioLanguages,
.videoDynamicRangeType,
.subtitles { .subtitles {
composes: cell from '~Components/Table/Cells/TableRowCell.css'; composes: cell from '~Components/Table/Cells/TableRowCell.css';

View File

@ -238,6 +238,20 @@ class EpisodeRow extends Component {
); );
} }
if (name === 'videoDynamicRangeType') {
return (
<TableRowCell
key={name}
className={styles.videoDynamicRangeType}
>
<MediaInfoConnector
type={mediaInfoTypes.VIDEO_DYNAMIC_RANGE_TYPE}
episodeFileId={episodeFileId}
/>
</TableRowCell>
);
}
if (name === 'size') { if (name === 'size') {
return ( return (
<TableRowCell <TableRowCell

View File

@ -74,6 +74,11 @@ export const defaultState = {
label: 'Video Codec', label: 'Video Codec',
isVisible: false isVisible: false
}, },
{
name: 'videoDynamicRangeType',
label: 'Video Dynamic Range',
isVisible: false
},
{ {
name: 'audioLanguages', name: 'audioLanguages',
label: 'Audio Languages', label: 'Audio Languages',

View File

@ -16,6 +16,8 @@ namespace Sonarr.Api.V3.EpisodeFiles
public int VideoBitrate { get; set; } public int VideoBitrate { get; set; }
public string VideoCodec { get; set; } public string VideoCodec { get; set; }
public decimal VideoFps { get; set; } public decimal VideoFps { get; set; }
public string VideoDynamicRange { get; set; }
public string VideoDynamicRangeType { get; set; }
public string Resolution { get; set; } public string Resolution { get; set; }
public string RunTime { get; set; } public string RunTime { get; set; }
public string ScanType { get; set; } public string ScanType { get; set; }
@ -42,6 +44,8 @@ namespace Sonarr.Api.V3.EpisodeFiles
VideoBitrate = model.VideoBitrate, VideoBitrate = model.VideoBitrate,
VideoCodec = MediaInfoFormatter.FormatVideoCodec(model, sceneName), VideoCodec = MediaInfoFormatter.FormatVideoCodec(model, sceneName),
VideoFps = model.VideoFps, VideoFps = model.VideoFps,
VideoDynamicRange = MediaInfoFormatter.FormatVideoDynamicRange(model),
VideoDynamicRangeType = MediaInfoFormatter.FormatVideoDynamicRangeType(model),
Resolution = $"{model.Width}x{model.Height}", Resolution = $"{model.Width}x{model.Height}",
RunTime = FormatRuntime(model.RunTime), RunTime = FormatRuntime(model.RunTime),
ScanType = model.ScanType, ScanType = model.ScanType,