1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-14 22:19:29 +01:00

Try to support "Subsonic" android app (#474)

This commit is contained in:
Andreas Shimokawa 2016-12-26 23:53:24 +01:00
parent bb8aff8c99
commit 440a5e071f
2 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,13 @@ public class MusicPlaybackReceiver extends BroadcastReceiver {
MusicSpec musicSpec = new MusicSpec();
musicSpec.artist = intent.getStringExtra("artist");
musicSpec.album = intent.getStringExtra("album");
musicSpec.track = intent.getStringExtra("track");
if (intent.hasExtra("track")) {
musicSpec.track = intent.getStringExtra("track");
}
else if (intent.hasExtra("title")) {
musicSpec.track = intent.getStringExtra("title");
}
musicSpec.duration = intent.getIntExtra("duration", 0) / 1000;
if (!lastMusicSpec.equals(musicSpec)) {

View File

@ -576,6 +576,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
mMusicPlaybackReceiver = new MusicPlaybackReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction("com.android.music.metachanged");
filter.addAction("net.sourceforge.subsonic.androidapp.EVENT_META_CHANGED");
//filter.addAction("com.android.music.playstatechanged");
registerReceiver(mMusicPlaybackReceiver, filter);
}