From 959c7c722033d41cd8c625da45aa11c8c46f0e06 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 3 Mar 2018 15:26:38 +0100 Subject: [PATCH] Correctly handle changing canPlay, canPause, canGoNext and canGoPrevious Summary: Gwenview is adding MPRIS support in D10972. I tested it and noticed that it was quite buggy. Turns out, Gwenviews implementation is (almost) fine, the problem was on our side. Unlike pure music players like Spotify Gwenview changes canPlay, canPause, canGoNext and canGoPrevious when needed, but those updates didn't reach our UI. The packages containing those updates were not parsed because they didn't contain several fields. Test Plan: Controlling Spotify and Gwenview (patched to support playPause) works fine now. Reviewers: #kde_connect, mtijink Reviewed By: #kde_connect, mtijink Subscribers: mtijink, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D10981 --- src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisPlugin.java b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisPlugin.java index d6e082a7..7a728fc7 100644 --- a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisPlugin.java @@ -263,7 +263,7 @@ public class MprisPlugin extends Plugin { @Override public boolean onPackageReceived(NetworkPackage np) { - if (np.has("nowPlaying") || np.has("volume") || np.has("isPlaying") || np.has("length") || np.has("pos")) { + if (np.has("player")) { MprisPlayer playerStatus = players.get(np.getString("player")); if (playerStatus != null) { playerStatus.currentSong = np.getString("nowPlaying", playerStatus.currentSong);