Fix scene bitrate unit (#1650)

This commit is contained in:
peolic 2021-08-24 04:33:46 +03:00 committed by GitHub
parent 0d4ab7f6f3
commit ac72d4db2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import React from "react";
import { FormattedNumber } from "react-intl";
import { FormattedMessage, FormattedNumber, useIntl } from "react-intl";
import * as GQL from "src/core/generated-graphql";
import { TextUtils } from "src/utils";
import { TextField, URLField } from "src/utils/field";
@ -11,6 +11,8 @@ interface ISceneFileInfoPanelProps {
export const SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
props: ISceneFileInfoPanelProps
) => {
const intl = useIntl();
function renderFileSize() {
if (props.scene.file.size === undefined) {
return;
@ -123,15 +125,21 @@ export const SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
truncate
/>
<TextField id="framerate">
<FormattedNumber value={props.scene.file.framerate ?? 0} /> frames per
second
<FormattedMessage
id="frames_per_second"
values={{ value: intl.formatNumber(props.scene.file.framerate ?? 0) }}
/>
</TextField>
<TextField id="bitrate">
<FormattedNumber
value={(props.scene.file.bitrate ?? 0) / 1000000}
maximumFractionDigits={2}
/>{" "}
frames per second
<FormattedMessage
id="megabits_per_second"
values={{
value: intl.formatNumber(
(props.scene.file.bitrate ?? 0) / 1000000,
{ maximumFractionDigits: 2 }
),
}}
/>
</TextField>
<TextField
id="media_info.video_codec"

View File

@ -505,6 +505,7 @@
"filter_name": "Filter name",
"filters": "Filters",
"framerate": "Frame Rate",
"frames_per_second": "{value} frames per second",
"galleries": "Galleries",
"gallery": "Gallery",
"gallery_count": "Gallery Count",
@ -541,6 +542,7 @@
"stream": "Stream",
"video_codec": "Video Codec"
},
"megabits_per_second": "{value} megabits per second",
"metadata": "Metadata",
"movie": "Movie",
"movie_scene_number": "Movie Scene Number",