From 9945c8dc0b0631f2ba62d16150fbf0a2669928fb Mon Sep 17 00:00:00 2001 From: jgibbon Date: Mon, 27 Feb 2023 00:15:18 +0100 Subject: [PATCH] Show player-supplied MPRIS Identity instead of dbus interface part if available --- main/qml/lib/MprisPlayingScanner.qml | 13 +++++++++++-- main/translations/harbour-slumber-de.ts | 4 ++-- main/translations/harbour-slumber-en.ts | 4 ++-- main/translations/harbour-slumber-es.ts | 4 ++-- main/translations/harbour-slumber-fi.ts | 4 ++-- main/translations/harbour-slumber-fr.ts | 4 ++-- main/translations/harbour-slumber-hu.ts | 4 ++-- main/translations/harbour-slumber-it.ts | 4 ++-- main/translations/harbour-slumber-nl.ts | 4 ++-- main/translations/harbour-slumber-nl_BE.ts | 4 ++-- main/translations/harbour-slumber-pl.ts | 4 ++-- main/translations/harbour-slumber-ru.ts | 4 ++-- main/translations/harbour-slumber-sl_SI.ts | 4 ++-- main/translations/harbour-slumber-sv.ts | 4 ++-- main/translations/harbour-slumber-zh.ts | 4 ++-- main/translations/harbour-slumber.ts | 4 ++-- 16 files changed, 41 insertions(+), 32 deletions(-) diff --git a/main/qml/lib/MprisPlayingScanner.qml b/main/qml/lib/MprisPlayingScanner.qml index 5cbeca5..6fc8688 100644 --- a/main/qml/lib/MprisPlayingScanner.qml +++ b/main/qml/lib/MprisPlayingScanner.qml @@ -12,8 +12,9 @@ Item { property bool mprisIsPlaying: false property string mprisPlayingService - property string mprisPlayingName: { - var match = mprisPlayingService.match(/([^.]+)$/); + property string mprisPlayingName + function getNameFromService(service) { + var match = service.match(/([^.]+)$/); return match ? match[0] : ''; } @@ -83,14 +84,21 @@ Item { service: dbusService path: '/org/mpris/MediaPlayer2' iface: 'org.mpris.MediaPlayer2.Player' + property DBusInterface playerInfo: DBusInterface { + service: dbif.service + path: dbif.path + iface: 'org.mpris.MediaPlayer2' + } property bool isPlaying: false onIsPlayingChanged: { if(isPlaying) { scanner.mprisPlayingService = service; + scanner.mprisPlayingName = playerInfo.getProperty('Identity') || getNameFromService(service); scanner.mprisIsPlaying = true; } else { if(scanner.mprisPlayingService === service) { scanner.mprisPlayingService = ''; + scanner.mprisPlayingName = ''; scanner.mprisIsPlaying = false; } } @@ -108,6 +116,7 @@ Item { Component.onDestruction: { if(scanner.mprisPlayingService === service) { scanner.mprisPlayingService = ''; + scanner.mprisPlayingName = ''; scanner.mprisIsPlaying = false; } } diff --git a/main/translations/harbour-slumber-de.ts b/main/translations/harbour-slumber-de.ts index 3a97cd3..ce58580 100644 --- a/main/translations/harbour-slumber-de.ts +++ b/main/translations/harbour-slumber-de.ts @@ -81,13 +81,13 @@ ziehe herunter für Einstellungen MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 spielt ab - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" gestoppt… diff --git a/main/translations/harbour-slumber-en.ts b/main/translations/harbour-slumber-en.ts index fc5220d..2e323a8 100644 --- a/main/translations/harbour-slumber-en.ts +++ b/main/translations/harbour-slumber-en.ts @@ -81,13 +81,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 is playing - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" stopped… diff --git a/main/translations/harbour-slumber-es.ts b/main/translations/harbour-slumber-es.ts index 7ae133c..7f9679d 100644 --- a/main/translations/harbour-slumber-es.ts +++ b/main/translations/harbour-slumber-es.ts @@ -81,13 +81,13 @@ tira hacia abajo para opciones MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Inicio automático: %1 se está reproduciendo - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" detenido... diff --git a/main/translations/harbour-slumber-fi.ts b/main/translations/harbour-slumber-fi.ts index 47c005e..fd3aff4 100644 --- a/main/translations/harbour-slumber-fi.ts +++ b/main/translations/harbour-slumber-fi.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-fr.ts b/main/translations/harbour-slumber-fr.ts index 2abf10a..dd0da71 100644 --- a/main/translations/harbour-slumber-fr.ts +++ b/main/translations/harbour-slumber-fr.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Démarrage auto : %1 est en train d'être joué - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-hu.ts b/main/translations/harbour-slumber-hu.ts index ae646d9..500af28 100644 --- a/main/translations/harbour-slumber-hu.ts +++ b/main/translations/harbour-slumber-hu.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Automatikus indítás: %1 lejátszása - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-it.ts b/main/translations/harbour-slumber-it.ts index dd8dd4d..ef9ce17 100644 --- a/main/translations/harbour-slumber-it.ts +++ b/main/translations/harbour-slumber-it.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 in riproduzione - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-nl.ts b/main/translations/harbour-slumber-nl.ts index 5ba2fb0..7ff5f9b 100644 --- a/main/translations/harbour-slumber-nl.ts +++ b/main/translations/harbour-slumber-nl.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 wordt afgespeeld - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-nl_BE.ts b/main/translations/harbour-slumber-nl_BE.ts index 6d218b9..be52c2d 100644 --- a/main/translations/harbour-slumber-nl_BE.ts +++ b/main/translations/harbour-slumber-nl_BE.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 wordt afgespeeld - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-pl.ts b/main/translations/harbour-slumber-pl.ts index df43bde..7413e45 100644 --- a/main/translations/harbour-slumber-pl.ts +++ b/main/translations/harbour-slumber-pl.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 jest odtwarzany - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" zatrzymany... diff --git a/main/translations/harbour-slumber-ru.ts b/main/translations/harbour-slumber-ru.ts index d0903b8..63becef 100644 --- a/main/translations/harbour-slumber-ru.ts +++ b/main/translations/harbour-slumber-ru.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Автозапуск: % 1 играет - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" diff --git a/main/translations/harbour-slumber-sl_SI.ts b/main/translations/harbour-slumber-sl_SI.ts index ff65ade..e4b6a5a 100644 --- a/main/translations/harbour-slumber-sl_SI.ts +++ b/main/translations/harbour-slumber-sl_SI.ts @@ -81,13 +81,13 @@ za možnosti potegni navzdol MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Samodejni zagon: %1 se predvaja - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" zaustavljeno ... diff --git a/main/translations/harbour-slumber-sv.ts b/main/translations/harbour-slumber-sv.ts index b55d55d..5322bc5 100644 --- a/main/translations/harbour-slumber-sv.ts +++ b/main/translations/harbour-slumber-sv.ts @@ -81,13 +81,13 @@ dra ner för alternativ MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" Autostart: %1 spelas - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" stoppad... diff --git a/main/translations/harbour-slumber-zh.ts b/main/translations/harbour-slumber-zh.ts index af20cec..38b4ad4 100644 --- a/main/translations/harbour-slumber-zh.ts +++ b/main/translations/harbour-slumber-zh.ts @@ -81,13 +81,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" 自动启动: %1 正在播放 - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…" 已停止… diff --git a/main/translations/harbour-slumber.ts b/main/translations/harbour-slumber.ts index 3d86449..5d42c4c 100644 --- a/main/translations/harbour-slumber.ts +++ b/main/translations/harbour-slumber.ts @@ -79,13 +79,13 @@ pull down for options MprisPlayingScanner - + Autostart: %1 is playing Notification text: %1 is the identifier of the current media player. This string is prefixed with "slumber ": "slumber Autostart: …" - + stopped… Notification text: Current media player has stopped. This string is prefixed with "slumber ": "slumber stopped…"