= {
- navidrome: stats as NavidromeDashboardData,
- audiobookshelf: null,
- };
- const navidromeStats = navidromeStatsByBackend[backend];
- const showNowPlayingSection =
- navidromeStats !== null && Boolean(options.showNowPlaying) && navidromeStats.nowPlaying.length > 0;
-
- const nowPlayingLimitByListVisibility = {
- true: options.maxNowPlayingItems ?? 3,
- false: 0,
- } as const;
-
- const nowPlayingTracks =
- navidromeStats?.nowPlaying.slice(
- 0,
- nowPlayingLimitByListVisibility[
- String(options.showNowPlayingList) as keyof typeof nowPlayingLimitByListVisibility
- ],
- ) ?? [];
-
- const hasContent = visibleStats.length > 0 || showNowPlayingSection;
-
return (
{visibleStats.length > 0 && (
@@ -80,40 +56,7 @@ export function AudioStatsContent({ backend, stats, options, width }: AudioStats
)}
- {showNowPlayingSection && navidromeStats && (
-
-
-
- {t("nowPlaying" as never)}
- {!options.showNowPlayingList && (
-
- {(t as unknown as (key: string, params?: { count: number }) => string)("nowPlayingCount", {
- count: navidromeStats.nowPlaying.length,
- })}
-
- )}
-
- {options.showNowPlayingList && (
-
- {nowPlayingTracks.map((track, index) => (
-
-
- {track.title}
-
- {[track.artist, track.album].filter(Boolean).join(" ยท ")}
-
-
-
- {track.username || track.playerName}
-
-
- ))}
-
- )}
-
- )}
-
- {!hasContent && (
+ {visibleStats.length === 0 && (
โ
diff --git a/packages/widgets/src/audio-stats/index.ts b/packages/widgets/src/audio-stats/index.ts
index 25af0bdaf..ffcd2dd93 100644
--- a/packages/widgets/src/audio-stats/index.ts
+++ b/packages/widgets/src/audio-stats/index.ts
@@ -1,5 +1,4 @@
import { IconHeadphones, IconServerOff } from "@tabler/icons-react";
-import { z } from "zod/v4";
import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";
@@ -23,14 +22,6 @@ export const { definition, componentLoader } = createWidgetDefinition("audioStat
showArtists: factory.switch({ defaultValue: true, withDescription: true }),
showAlbums: factory.switch({ defaultValue: true, withDescription: true }),
showSongs: factory.switch({ defaultValue: true, withDescription: true }),
- showNowPlaying: factory.switch({ defaultValue: true, withDescription: true }),
- showNowPlayingList: factory.switch({ defaultValue: true, withDescription: true }),
- maxNowPlayingItems: factory.number({
- defaultValue: 3,
- validate: z.number().min(1).max(5),
- step: 1,
- withDescription: true,
- }),
showLibraryCount: factory.switch({ defaultValue: true, withDescription: true }),
showAudiobooks: factory.switch({ defaultValue: true, withDescription: true }),
showPodcasts: factory.switch({ defaultValue: true, withDescription: true }),
@@ -42,9 +33,6 @@ export const { definition, componentLoader } = createWidgetDefinition("audioStat
showArtists: hideUnlessNavidrome,
showAlbums: hideUnlessNavidrome,
showSongs: hideUnlessNavidrome,
- showNowPlaying: hideUnlessNavidrome,
- showNowPlayingList: hideUnlessNavidrome,
- maxNowPlayingItems: hideUnlessNavidrome,
showLibraryCount: hideUnlessAudiobookshelf,
showAudiobooks: hideUnlessAudiobookshelf,
showPodcasts: hideUnlessAudiobookshelf,
diff --git a/packages/widgets/src/audio-stats/shared.ts b/packages/widgets/src/audio-stats/shared.ts
index 39fc9b0b6..d4b79c72c 100644
--- a/packages/widgets/src/audio-stats/shared.ts
+++ b/packages/widgets/src/audio-stats/shared.ts
@@ -19,9 +19,6 @@ export interface NavidromeDisplayOptions {
showArtists: boolean;
showAlbums: boolean;
showSongs: boolean;
- showNowPlaying: boolean;
- showNowPlayingList: boolean;
- maxNowPlayingItems: number;
compactMode?: boolean;
}