Commit 40b2226c authored by Bharadwaj Raju's avatar Bharadwaj Raju
Browse files

If an app is playing media but hasn't provided a title, say as much instead of "No media playing"

Certain apps, like GNOME's Totem, provide a very rudimentary MPRIS interface with next-to-no
metadata. Currently the applet and lockscreen show "No media playing" when these apps play something, which is
inaccurate. Change the message in case of (playing || paused) && !title to "No title".

BUG: 456516

(cherry picked from commit 62e5bb37)
parent 98cc8b38
Pipeline #243863 passed with stage
in 7 minutes and 18 seconds
......@@ -158,7 +158,7 @@ Item {
anchors.centerIn: parent
width: parent.width // For text wrap
iconName: albumArt.icon
text: i18n("No media playing")
text: (root.isPlaying || root.state === "paused") ? i18n("No title") : i18n("No media playing")
......@@ -102,7 +102,11 @@ Item {
Layout.fillWidth: true
wrapMode: Text.NoWrap
elide: Text.ElideRight
text: mpris2Source.track || i18nd("plasma_lookandfeel_org.kde.lookandfeel", "No media playing")
text: mpris2Source.track.length > 0
? mpris2Source.track
: ((mpris2Source.hasPlayer && ["Playing", "Paused"].includes(mpris2Source.playerData.PlaybackStatus))
? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "No title")
: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "No media playing"))
textFormat: Text.PlainText
font.pointSize: PlasmaCore.Theme.defaultFont.pointSize + 1
maximumLineCount: 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment