mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Renaming functions
This commit is contained in:
parent
40866a2855
commit
9fdc9ff44d
3 changed files with 7 additions and 8 deletions
|
|
@ -134,8 +134,8 @@ public class QueueRepository {
|
|||
thread.start();
|
||||
}
|
||||
|
||||
public void setPlayingChangedTimestamp(String id, long ms) {
|
||||
SetPlayingChangedTimestampThreadSafe timestamp = new SetPlayingChangedTimestampThreadSafe(queueDao, id, ms);
|
||||
public void setPlayingPausedTimestamp(String id, long ms) {
|
||||
SetPlayingPausedTimestampThreadSafe timestamp = new SetPlayingPausedTimestampThreadSafe(queueDao, id, ms);
|
||||
Thread thread = new Thread(timestamp);
|
||||
thread.start();
|
||||
}
|
||||
|
|
@ -268,12 +268,12 @@ public class QueueRepository {
|
|||
}
|
||||
}
|
||||
|
||||
private static class SetPlayingChangedTimestampThreadSafe implements Runnable {
|
||||
private static class SetPlayingPausedTimestampThreadSafe implements Runnable {
|
||||
private final QueueDao queueDao;
|
||||
private final String songId;
|
||||
private final long ms;
|
||||
|
||||
public SetPlayingChangedTimestampThreadSafe(QueueDao queueDao, String songId, long ms) {
|
||||
public SetPlayingPausedTimestampThreadSafe(QueueDao queueDao, String songId, long ms) {
|
||||
this.queueDao = queueDao;
|
||||
this.songId = songId;
|
||||
this.ms = ms;
|
||||
|
|
|
|||
|
|
@ -271,8 +271,8 @@ public class MediaManager {
|
|||
if (mediaItem != null) getQueueRepository().setLastPlayedTimestamp(mediaItem.mediaId);
|
||||
}
|
||||
|
||||
public static void setPlayingChangedTimestamp(MediaItem mediaItem, long ms) {
|
||||
if (mediaItem != null) getQueueRepository().setPlayingChangedTimestamp(mediaItem.mediaId, ms);
|
||||
public static void setPlayingPausedTimestamp(MediaItem mediaItem, long ms) {
|
||||
if (mediaItem != null) getQueueRepository().setPlayingPausedTimestamp(mediaItem.mediaId, ms);
|
||||
}
|
||||
|
||||
private static QueueRepository getQueueRepository() {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.cappielloantonio.play.service;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.AudioAttributes;
|
||||
|
|
@ -102,7 +101,7 @@ public class MediaService extends MediaLibraryService {
|
|||
@Override
|
||||
public void onIsPlayingChanged(boolean isPlaying) {
|
||||
if(isPlaying) {
|
||||
MediaManager.setPlayingChangedTimestamp(player.getCurrentMediaItem(), player.getCurrentPosition());
|
||||
MediaManager.setPlayingPausedTimestamp(player.getCurrentMediaItem(), player.getCurrentPosition());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue