mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 23:13:36 +00:00
Implemented scobble action
This commit is contained in:
@@ -381,6 +381,8 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
||||
nextPosition = getNextPosition();
|
||||
playback.queueDataSource(getSongAt(nextPosition));
|
||||
}
|
||||
|
||||
increaseSongCount();
|
||||
}
|
||||
|
||||
public void initNotification() {
|
||||
@@ -637,7 +639,6 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
||||
saveProgress();
|
||||
break;
|
||||
case QUEUE_CHANGED:
|
||||
// because playing queue size might have changed
|
||||
updateMediaSessionMetadata();
|
||||
saveState();
|
||||
if (playingQueue.size() > 0) {
|
||||
@@ -659,6 +660,11 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
private void increaseSongCount() {
|
||||
SongRepository songRepository = new SongRepository(App.getInstance());
|
||||
songRepository.scrobble(getCurrentSong().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChanged(int state) {
|
||||
notifyChange(STATE_CHANGED);
|
||||
|
||||
Reference in New Issue
Block a user