mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Send Bits and SampleRate to UI for TrackFiles
This commit is contained in:
parent
6057127ec0
commit
e998f9c029
3 changed files with 29 additions and 11 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue