diff --git a/docs/widgets/services/emby.md b/docs/widgets/services/emby.md index e658d73b7..5027d408d 100644 --- a/docs/widgets/services/emby.md +++ b/docs/widgets/services/emby.md @@ -17,6 +17,7 @@ widget: enableBlocks: true # optional, defaults to false enableNowPlaying: true # optional, defaults to true enableUser: true # optional, defaults to false + enableMediaControl: false # optional, defaults to true showEpisodeNumber: true # optional, defaults to false expandOneStreamToTwoRows: false # optional, defaults to true ``` diff --git a/docs/widgets/services/jellyfin.md b/docs/widgets/services/jellyfin.md index b6724a152..667930e3c 100644 --- a/docs/widgets/services/jellyfin.md +++ b/docs/widgets/services/jellyfin.md @@ -17,6 +17,7 @@ widget: enableBlocks: true # optional, defaults to false enableNowPlaying: true # optional, defaults to true enableUser: true # optional, defaults to false + enableMediaControl: false # optional, defaults to true showEpisodeNumber: true # optional, defaults to false expandOneStreamToTwoRows: false # optional, defaults to true ``` diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index 3e343cbdf..79e3a489b 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -295,6 +295,7 @@ export function cleanServiceGroups(groups) { // emby, jellyfin enableBlocks, enableNowPlaying, + enableMediaControl, // emby, jellyfin, tautulli enableUser, @@ -471,6 +472,7 @@ export function cleanServiceGroups(groups) { if (wan) widget.wan = wan; } if (["emby", "jellyfin"].includes(type)) { + if (enableMediaControl !== undefined) widget.enableMediaControl = !!JSON.parse(enableMediaControl); if (enableBlocks !== undefined) widget.enableBlocks = JSON.parse(enableBlocks); if (enableNowPlaying !== undefined) widget.enableNowPlaying = JSON.parse(enableNowPlaying); } diff --git a/src/widgets/emby/component.jsx b/src/widgets/emby/component.jsx index 88858da2a..0eaff8291 100644 --- a/src/widgets/emby/component.jsx +++ b/src/widgets/emby/component.jsx @@ -45,7 +45,7 @@ function generateStreamTitle(session, enableUser, showEpisodeNumber) { return enableUser ? `${streamTitle} (${UserName})` : streamTitle; } -function SingleSessionEntry({ playCommand, session, enableUser, showEpisodeNumber }) { +function SingleSessionEntry({ playCommand, session, enableUser, showEpisodeNumber, enableMediaControl }) { const { PlayState: { PositionTicks, IsPaused, IsMuted }, } = session; @@ -85,7 +85,7 @@ function SingleSessionEntry({ playCommand, session, enableUser, showEpisodeNumbe }} />
- {IsPaused && ( + {enableMediaControl && IsPaused && ( { playCommand(session, "Unpause"); @@ -93,7 +93,7 @@ function SingleSessionEntry({ playCommand, session, enableUser, showEpisodeNumbe className="inline-block w-4 h-4 cursor-pointer -mt-[1px] mr-1 opacity-80" /> )} - {!IsPaused && ( + {enableMediaControl && !IsPaused && ( { playCommand(session, "Pause"); @@ -114,7 +114,7 @@ function SingleSessionEntry({ playCommand, session, enableUser, showEpisodeNumbe ); } -function SessionEntry({ playCommand, session, enableUser, showEpisodeNumber }) { +function SessionEntry({ playCommand, session, enableUser, showEpisodeNumber, enableMediaControl }) { const { PlayState: { PositionTicks, IsPaused, IsMuted }, } = session; @@ -139,7 +139,7 @@ function SessionEntry({ playCommand, session, enableUser, showEpisodeNumber }) { }} />
- {IsPaused && ( + {enableMediaControl && IsPaused && ( { playCommand(session, "Unpause"); @@ -147,7 +147,7 @@ function SessionEntry({ playCommand, session, enableUser, showEpisodeNumber }) { className="inline-block w-4 h-4 cursor-pointer -mt-[1px] mr-1 opacity-80" /> )} - {!IsPaused && ( + {enableMediaControl && !IsPaused && ( { playCommand(session, "Pause"); @@ -238,6 +238,7 @@ export default function Component({ service }) { const enableBlocks = service.widget?.enableBlocks; const enableNowPlaying = service.widget?.enableNowPlaying ?? true; + const enableMediaControl = service.widget?.enableMediaControl !== false; // default is true const enableUser = !!service.widget?.enableUser; // default is false const expandOneStreamToTwoRows = service.widget?.expandOneStreamToTwoRows !== false; // default is true const showEpisodeNumber = !!service.widget?.showEpisodeNumber; // default is false @@ -304,6 +305,7 @@ export default function Component({ service }) { session={session} enableUser={enableUser} showEpisodeNumber={showEpisodeNumber} + enableMediaControl={enableMediaControl} />
@@ -321,6 +323,7 @@ export default function Component({ service }) { session={session} enableUser={enableUser} showEpisodeNumber={showEpisodeNumber} + enableMediaControl={enableMediaControl} /> ))}