mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Add function to increase song count when track is changed
This commit is contained in:
parent
2b5a686fe4
commit
0c401fce95
2 changed files with 17 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ import com.cappielloantonio.play.R;
|
|||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.repository.QueueRepository;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.service.notification.PlayingNotification;
|
||||
import com.cappielloantonio.play.service.playback.Playback;
|
||||
import com.cappielloantonio.play.util.PreferenceUtil;
|
||||
|
|
@ -436,6 +437,8 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
|||
nextPosition = getNextPosition();
|
||||
playback.queueDataSource(getSongAt(nextPosition));
|
||||
}
|
||||
|
||||
increaseSongCount();
|
||||
}
|
||||
|
||||
private boolean requestFocus() {
|
||||
|
|
@ -735,6 +738,11 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
|||
}
|
||||
}
|
||||
|
||||
private void increaseSongCount() {
|
||||
SongRepository songRepository = new SongRepository(App.getInstance());
|
||||
songRepository.increasePlayCount(getCurrentSong());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChanged(int state) {
|
||||
notifyChange(STATE_CHANGED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue