From f0f437b591df469249c8b92c72e73dbb02425e37 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Thu, 6 Mar 2025 09:49:46 +0800 Subject: [PATCH 1/4] chore: add .env to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8ac67f2..409cb45 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /backend/backup-data .vscode .idea +.env # production /build From 03b3899f6d802779f8dc85947ff854bb4db4038b Mon Sep 17 00:00:00 2001 From: sususu98 Date: Tue, 11 Mar 2025 15:22:16 +0800 Subject: [PATCH 2/4] feat: add DirectStream support in item-activity, playback_method_stats, and user-activity. --- public/locales/zh-CN/translation.json | 1 + .../components/activity/activity-table.jsx | 31 +++++++++++++++++++ .../components/item-info/item-activity.jsx | 5 ++- .../statCards/playback_method_stats.jsx | 15 ++++++--- .../components/user-info/user-activity.jsx | 3 ++ 5 files changed, 50 insertions(+), 5 deletions(-) diff --git a/public/locales/zh-CN/translation.json b/public/locales/zh-CN/translation.json index a16763b..eb5add8 100644 --- a/public/locales/zh-CN/translation.json +++ b/public/locales/zh-CN/translation.json @@ -283,6 +283,7 @@ "SOURCE_DETAILS": "媒体源信息", "DIRECT": "直接播放", "TRANSCODE": "转码", + "DIRECT_STREAM": "直接流", "USERNAME": "用户名", "PASSWORD": "密码", "LOGIN": "登录", diff --git a/src/pages/components/activity/activity-table.jsx b/src/pages/components/activity/activity-table.jsx index 65ed9c8..0df5cc1 100644 --- a/src/pages/components/activity/activity-table.jsx +++ b/src/pages/components/activity/activity-table.jsx @@ -214,6 +214,37 @@ export default function ActivityTable(props) { ); }, }, + { + accessorKey: "PlayMethod", + header: i18next.t("TRANSCODE"), + size: 150, + Cell: ({ row }) => { + row = row.original; + if (row.PlayMethod === "Transcode") { + return ( + + {i18next.t("TRANSCODE")} + {row.TranscodingInfo ? + + {!row.TranscodingInfo.IsVideoDirect && + ({i18next.t("VIDEO")}) + } + {!row.TranscodingInfo.IsAudioDirect && + ({i18next.t("AUDIO")}) + } + : "" + } + + ); + } else if (row.PlayMethod === "DirectPlay") { + return {i18next.t("DIRECT")}; + } else if (row.PlayMethod === "DirectStream") { + return {i18next.t("DIRECT_STREAM")}; + } else { + return -; + } + }, + }, { accessorKey: "DeviceName", header: i18next.t("ACTIVITY_TABLE.DEVICE"), diff --git a/src/pages/components/item-info/item-activity.jsx b/src/pages/components/item-info/item-activity.jsx index ebb52f6..960b629 100644 --- a/src/pages/components/item-info/item-activity.jsx +++ b/src/pages/components/item-info/item-activity.jsx @@ -122,7 +122,7 @@ function ItemActivity(props) { // } filteredData = filteredData.filter((item) => - streamTypeFilter == "All" + streamTypeFilter === "All" ? true : item.PlayMethod === (config?.IS_JELLYFIN ? streamTypeFilter : streamTypeFilter.replace("Play", "Stream")) ); @@ -155,6 +155,9 @@ function ItemActivity(props) { + diff --git a/src/pages/components/statCards/playback_method_stats.jsx b/src/pages/components/statCards/playback_method_stats.jsx index c285213..ebcc2ab 100644 --- a/src/pages/components/statCards/playback_method_stats.jsx +++ b/src/pages/components/statCards/playback_method_stats.jsx @@ -10,7 +10,8 @@ import BarChartGroupedLineIcon from "remixicon-react/BarChartGroupedLineIcon"; function PlaybackMethodStats(props) { const translations = { DirectPlay: , - Transocde: , + Transcode: , + DirectStream: }; const chartIcon = ; @@ -78,9 +79,15 @@ function PlaybackMethodStats(props) { return ( - stream.Name == "DirectPlay" ? { ...stream, Name: translations.DirectPlay } : { ...stream, Name: translations.Transocde } - )} + data={data.map((stream) => { + if (stream.Name === "DirectPlay") { + return { ...stream, Name: translations.DirectPlay }; + } else if (stream.Name === "DirectStream") { + return { ...stream, Name: translations.DirectStream }; + } else { + return { ...stream, Name: translations.Transcode }; + } + })} icon={chartIcon} heading={} units={} diff --git a/src/pages/components/user-info/user-activity.jsx b/src/pages/components/user-info/user-activity.jsx index ccdc360..5776821 100644 --- a/src/pages/components/user-info/user-activity.jsx +++ b/src/pages/components/user-info/user-activity.jsx @@ -226,6 +226,9 @@ function UserActivity(props) { + From 49d7382a65f34394f4cd3ed614a5acd6b96e7921 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Tue, 11 Mar 2025 15:42:45 +0800 Subject: [PATCH 3/4] 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(", ")} + + + )} ); From 4ca537e7ec228cee450cc007dc89a9da7e2ba984 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Tue, 11 Mar 2025 17:29:26 +0800 Subject: [PATCH 4/4] docs(translation): add and update translations for Chinese locale --- public/locales/zh-CN/translation.json | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/public/locales/zh-CN/translation.json b/public/locales/zh-CN/translation.json index a0da4fb..2b5da2a 100644 --- a/public/locales/zh-CN/translation.json +++ b/public/locales/zh-CN/translation.json @@ -8,7 +8,8 @@ "STATISTICS": "统计", "SETTINGS": "设置", "ABOUT": "关于", - "LOGOUT": "注销" + "LOGOUT": "注销", + "TIMELINE": "时间线" }, "HOME_PAGE": { "SESSIONS": "会话", @@ -18,8 +19,8 @@ }, "SESSIONS": { "NO_SESSIONS": "未找到活动会话", - "DIRECT_PLAY": "", - "TRANSCODE": "" + "DIRECT_PLAY": "直接播放", + "TRANSCODE": "转码" }, "STAT_CARDS": { "MOST_VIEWED_MOVIES": "最多观看电影", @@ -77,7 +78,8 @@ "TAB_CONTROLS": { "OVERVIEW": "总览", "ACTIVITY": "活动", - "OPTIONS": "选项" + "OPTIONS": "选项", + "TIMELINE": "时间线" }, "ITEM_ACTIVITY": "活动项目", "ACTIVITY_TABLE": { @@ -116,7 +118,7 @@ "PURGE_LIBRARY_CACHE_WITH_ACTIVITY": "清除已缓存媒体库、项目及活动", "PURGE_LIBRARY_ITEMS_CACHE": "仅清除已缓存媒体库项目", "PURGE_LIBRARY_ITEMS_CACHE_WITH_ACTIVITY": "仅清除已缓存媒体库项目和活动", - "PURGE_ACTIVITY": "确定要清除已选中的播放活动?" + "PURGE_ACTIVITY": "确定要删除已选中的播放活动?" }, "ERROR_MESSAGES": { "FETCH_THIS_ITEM": "从 Jellyfin 获取此项目", @@ -179,7 +181,7 @@ "SIZE": "大小", "JELLYFIN_URL": "Jellyfin URL", "EMBY_URL": "Emby URL", - "EXTERNAL_URL": "External URL", + "EXTERNAL_URL": "外部链接", "API_KEY": "API 密钥", "API_KEYS": "API 密钥", "KEY_NAME": "密钥名称", @@ -231,7 +233,7 @@ "Backup": "备份 Jellystat" }, "SEARCH": "搜索", - "TOTAL": "Total", + "TOTAL": "总计", "LAST": "过去", "SERIES": "剧集", "SEASON": "季", @@ -283,7 +285,7 @@ "SOURCE_DETAILS": "媒体源信息", "DIRECT": "直接播放", "TRANSCODE": "转码", - "DIRECT_STREAM": "直接流", + "DIRECT_STREAM": "直接串流", "USERNAME": "用户名", "PASSWORD": "密码", "LOGIN": "登录", @@ -306,5 +308,9 @@ "POSTCODE": "邮编", "X_ROWS_SELECTED": "已选中 {ROWS} 行", "TRANSCODE_REASONS": "转码原因", - "SUBTITLES": "" + "SUBTITLES": "字幕", + "TIMELINE_PAGE": { + "TIMELINE": "时间线", + "EPISODES": "集数" + } }