New: Send Bits and SampleRate to UI for TrackFiles

pull/6/head
Qstick 6 years ago
parent 6057127ec0
commit e998f9c029

@ -19,7 +19,7 @@
.audio { .audio {
composes: cell from '~Components/Table/Cells/TableRowCell.css'; composes: cell from '~Components/Table/Cells/TableRowCell.css';
width: 200px; width: 250px;
} }
.language, .language,

@ -8,7 +8,8 @@ function MediaInfo(props) {
audioChannels, audioChannels,
audioCodec, audioCodec,
audioBitRate, audioBitRate,
videoCodec audioBits,
audioSampleRate
} = props; } = props;
if (type === mediaInfoTypes.AUDIO) { if (type === mediaInfoTypes.AUDIO) {
@ -38,14 +39,26 @@ function MediaInfo(props) {
!!audioBitRate && !!audioBitRate &&
audioBitRate audioBitRate
} }
</span>
);
}
if (type === mediaInfoTypes.VIDEO) { {
return ( ((!!audioCodec && !!audioSampleRate) || (!!audioChannels && !!audioSampleRate) || (!!audioBitRate && !!audioSampleRate)) &&
<span> ' - '
{videoCodec} }
{
!!audioSampleRate &&
audioSampleRate
}
{
((!!audioCodec && !!audioBits) || (!!audioChannels && !!audioBits) || (!!audioBitRate && !!audioBits) || (!!audioSampleRate && !!audioBits)) &&
' - '
}
{
!!audioBits &&
audioBits
}
</span> </span>
); );
} }
@ -58,7 +71,8 @@ MediaInfo.propTypes = {
audioChannels: PropTypes.number, audioChannels: PropTypes.number,
audioCodec: PropTypes.string, audioCodec: PropTypes.string,
audioBitRate: PropTypes.string, audioBitRate: PropTypes.string,
videoCodec: PropTypes.string audioBits: PropTypes.string,
audioSampleRate: PropTypes.string
}; };
export default MediaInfo; export default MediaInfo;

@ -9,6 +9,8 @@ namespace Lidarr.Api.V1.TrackFiles
public decimal AudioChannels { get; set; } public decimal AudioChannels { get; set; }
public string AudioBitRate { get; set; } public string AudioBitRate { get; set; }
public string AudioCodec { get; set; } public string AudioCodec { get; set; }
public string AudioBits { get; set; }
public string AudioSampleRate { get; set; }
} }
public static class MediaInfoResourceMapper public static class MediaInfoResourceMapper
@ -24,7 +26,9 @@ namespace Lidarr.Api.V1.TrackFiles
{ {
AudioChannels = MediaInfoFormatter.FormatAudioChannels(model), AudioChannels = MediaInfoFormatter.FormatAudioChannels(model),
AudioCodec = MediaInfoFormatter.FormatAudioCodec(model), AudioCodec = MediaInfoFormatter.FormatAudioCodec(model),
AudioBitRate = MediaInfoFormatter.FormatAudioBitrate(model) AudioBitRate = MediaInfoFormatter.FormatAudioBitrate(model),
AudioBits = MediaInfoFormatter.FormatAudioBitsPerSample(model),
AudioSampleRate = MediaInfoFormatter.FormatAudioSampleRate(model)
}; };
} }
} }

Loading…
Cancel
Save