From 8d09a1e4d47dfc77df00a09ba92538a2d16593f8 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 21 Nov 2024 20:06:01 +0100 Subject: [PATCH] Remove "- Topic" suffix from artists in mpris --- modules/wm/ags/modules/mpris.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/wm/ags/modules/mpris.js b/modules/wm/ags/modules/mpris.js index 41c6709..e6465f1 100644 --- a/modules/wm/ags/modules/mpris.js +++ b/modules/wm/ags/modules/mpris.js @@ -36,7 +36,7 @@ const ArtistLabel = ({ player, ...props }) => wrap: true, truncate: "end", hpack: "start", - label: player.bind("track_artists").transform((x) => x.join(", ")), + label: player.bind("track_artists").transform((x) => x.map(y => y.replace(/- Topic$/, "")).join(", ")), ...props, }); @@ -147,7 +147,7 @@ export const LinePlayer = ({ player, ...props }) => Widget.Label({ label: Utils.merge( [player.bind("track_title"), player.bind("track_artists")], - (title, artists) => `${title} - ${artists.join(", ")}`, + (title, artists) => `${title} - ${artists.map(x => x.replace(/- Topic$/, "")).join(", ")}`, ), maxWidthChars: 30, wrap: true,