From 49d7382a65f34394f4cd3ed614a5acd6b96e7921 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Tue, 11 Mar 2025 15:42:45 +0800 Subject: [PATCH] feat(src/pages/components/activity/stream_info.jsx): add transcode reasons and update video/audio stream detection logic. --- public/locales/zh-CN/translation.json | 1 + src/pages/components/activity/stream_info.jsx | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/public/locales/zh-CN/translation.json b/public/locales/zh-CN/translation.json index eb5add8..a0da4fb 100644 --- a/public/locales/zh-CN/translation.json +++ b/public/locales/zh-CN/translation.json @@ -305,5 +305,6 @@ "TIMEZONE": "时区", "POSTCODE": "邮编", "X_ROWS_SELECTED": "已选中 {ROWS} 行", + "TRANSCODE_REASONS": "转码原因", "SUBTITLES": "" } diff --git a/src/pages/components/activity/stream_info.jsx b/src/pages/components/activity/stream_info.jsx index d5ced2a..3d1cfd8 100644 --- a/src/pages/components/activity/stream_info.jsx +++ b/src/pages/components/activity/stream_info.jsx @@ -61,7 +61,13 @@ function Row(logs) { - {data.TranscodingInfo ? (data.TranscodingInfo?.IsVideoDirect ? i18next.t("DIRECT") :i18next.t("TRANSCODE")):i18next.t("DIRECT")} + + {data.PlayMethod === "DirectStream" ? + i18next.t("DIRECT_STREAM") : + (data.TranscodingInfo ? + (data.TranscodingInfo?.IsVideoDirect ? i18next.t("DIRECT") : i18next.t("TRANSCODE")) : + i18next.t("DIRECT"))} + @@ -108,7 +114,13 @@ function Row(logs) { - {data.TranscodingInfo ? (data.TranscodingInfo?.IsAudioDirect ? i18next.t("DIRECT") :i18next.t("TRANSCODE")):i18next.t("DIRECT")} + + {data.PlayMethod === "DirectStream" ? + i18next.t("DIRECT_STREAM") : + (data.TranscodingInfo ? + (data.TranscodingInfo?.IsAudioDirect ? i18next.t("DIRECT") : i18next.t("TRANSCODE")) : + i18next.t("DIRECT"))} + @@ -135,7 +147,16 @@ function Row(logs) { {data.MediaStreams ? data.MediaStreams.find(stream => stream.Type === 'Audio' && stream.Index===data.PlayState?.AudioStreamIndex)?.Language?.toUpperCase() : '-'} - + {data.TranscodingInfo && data.TranscodingInfo?.TranscodeReasons && data.TranscodingInfo.TranscodeReasons.length > 0 && ( + <> + + + + + {data.TranscodingInfo.TranscodeReasons.join(", ")} + + + )} );