From 3e73fb65ead76accca59f0ad327dc027062838b8 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:06:53 -0800 Subject: [PATCH] Use compact now playing format --- public/locales/en/common.json | 6 ++-- src/widgets/navidrome/component.jsx | 49 +++++++++++++++-------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 94ac652b..afba679a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -169,10 +169,8 @@ "middleware": "Middleware" }, "navidrome": { - "user": "User", - "artist": "Artist", - "song": "Song", - "album": "Album" + "nothing_streaming": "No Active Streams", + "please_wait": "Please Wait" }, "npm": { "enabled": "Enabled", diff --git a/src/widgets/navidrome/component.jsx b/src/widgets/navidrome/component.jsx index 360dac97..f4f3e672 100644 --- a/src/widgets/navidrome/component.jsx +++ b/src/widgets/navidrome/component.jsx @@ -1,9 +1,24 @@ import { useTranslation } from "next-i18next"; import Container from "components/services/widget/container"; -import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; +function SinglePlayingEntry({ entry }) { + const { username, artist, title, album } = entry; + let fullTitle = title; + if (artist) fullTitle = `${artist} - ${title}`; + if (album) fullTitle += ` — ${album}`; + if (username) fullTitle += ` (${username})`; + + return ( +