diff --git a/src/components/services/widgets/service/emby.jsx b/src/components/services/widgets/service/emby.jsx index 35f31f181..5b0711d6f 100644 --- a/src/components/services/widgets/service/emby.jsx +++ b/src/components/services/widgets/service/emby.jsx @@ -1,6 +1,7 @@ import useSWR from "swr"; import { useTranslation } from "react-i18next"; -import { BsVolumeMuteFill, BsFillPlayFill, BsPauseFill } from "react-icons/bs"; +import { BsVolumeMuteFill, BsFillPlayFill, BsPauseFill, BsCpu, BsFillCpuFill } from "react-icons/bs"; +import { MdOutlineSmartDisplay } from "react-icons/md"; import Widget from "../widget"; @@ -27,24 +28,35 @@ function ticksToString(ticks) { } function SingleSessionEntry({ playCommand, session }) { - console.log(session); const { NowPlayingItem: { Name, SeriesName, RunTimeTicks }, PlayState: { PositionTicks, IsPaused, IsMuted }, } = session; + + const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || { + IsVideoDirect: true, + VideoDecoderIsHardware: true, + VideoEncoderIsHardware: true, + }; + const percent = (PositionTicks / RunTimeTicks) * 100; return ( <>
-
- +
+
{Name} {SeriesName && ` - ${SeriesName}`} - +
+
+
+ {IsVideoDirect && } + {!IsVideoDirect && (!VideoDecoderIsHardware || !VideoEncoderIsHardware) && } + {!IsVideoDirect && VideoDecoderIsHardware && VideoEncoderIsHardware && ( + + )}
-
-
{IsMuted && }
@@ -73,7 +85,12 @@ function SingleSessionEntry({ playCommand, session }) { )}
-
{ticksToString(PositionTicks)}
+
{IsMuted && }
+
+ {ticksToString(PositionTicks)} + / + {ticksToString(RunTimeTicks)} +
); @@ -84,6 +101,9 @@ function SessionEntry({ playCommand, session }) { NowPlayingItem: { Name, SeriesName, RunTimeTicks }, PlayState: { PositionTicks, IsPaused, IsMuted }, } = session; + + const { IsVideoDirect, VideoDecoderIsHardware, VideoEncoderIsHardware } = session?.TranscodingInfo || {}; + const percent = (PositionTicks / RunTimeTicks) * 100; return ( @@ -111,14 +131,20 @@ function SessionEntry({ playCommand, session }) { className="inline-block w-4 h-4 cursor-pointer -mt-[1px] mr-1 opacity-80" /> )} - +
+
+
{Name} {SeriesName && ` - ${SeriesName}`} - +
+
+
{IsMuted && }
+
{ticksToString(PositionTicks)}
+
+ {IsVideoDirect && } + {!IsVideoDirect && (!VideoDecoderIsHardware || !VideoEncoderIsHardware) && } + {!IsVideoDirect && VideoDecoderIsHardware && VideoEncoderIsHardware && }
-
-
{IsMuted && }
-
{ticksToString(PositionTicks)}
); } diff --git a/src/components/services/widgets/service/tautulli.jsx b/src/components/services/widgets/service/tautulli.jsx index 4a97b8d79..2b7b75c15 100644 --- a/src/components/services/widgets/service/tautulli.jsx +++ b/src/components/services/widgets/service/tautulli.jsx @@ -1,7 +1,8 @@ /* eslint-disable camelcase */ import useSWR from "swr"; import { useTranslation } from "react-i18next"; -import { BsFillPlayFill, BsPauseFill } from "react-icons/bs"; +import { BsFillPlayFill, BsPauseFill, BsCpu, BsFillCpuFill } from "react-icons/bs"; +import { MdOutlineSmartDisplay } from "react-icons/md"; import Widget from "../widget"; @@ -27,16 +28,19 @@ function millisecondsToString(milliseconds) { } function SingleSessionEntry({ session }) { - const { full_title, duration, view_offset, progress_percent, state, year, grandparent_year } = session; + const { full_title, duration, view_offset, progress_percent, state, video_decision, audio_decision } = session; return ( <>
-
- {full_title} +
+
{full_title}
+
+
+ {video_decision === "copy" && audio_decision === "copy" && } + {video_decision !== "copy" && audio_decision !== "copy" && } + {video_decision === "copy" && audio_decision !== "copy" && }
-
-
{year || grandparent_year}
@@ -56,7 +60,9 @@ function SingleSessionEntry({ session }) {
- {millisecondsToString(view_offset)} / {millisecondsToString(duration)} + {millisecondsToString(view_offset)} + / + {millisecondsToString(duration)}
@@ -64,7 +70,7 @@ function SingleSessionEntry({ session }) { } function SessionEntry({ session }) { - const { full_title, view_offset, progress_percent, state } = session; + const { full_title, view_offset, progress_percent, state, video_decision, audio_decision } = session; return (
@@ -81,8 +87,16 @@ function SessionEntry({ session }) { {state !== "paused" && ( )} - {full_title}
+
+
{full_title}
+
+
+ {video_decision === "copy" && audio_decision === "copy" && } + {video_decision !== "copy" && audio_decision !== "copy" && } + {video_decision === "copy" && audio_decision !== "copy" && } +
+
{millisecondsToString(view_offset)}