mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Implemented scobble action
This commit is contained in:
parent
4fc29b47be
commit
6f1046b137
5 changed files with 136 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue