mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +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();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayingChangedTimestamp(String id, long ms) {
|
public void setPlayingPausedTimestamp(String id, long ms) {
|
||||||
SetPlayingChangedTimestampThreadSafe timestamp = new SetPlayingChangedTimestampThreadSafe(queueDao, id, ms);
|
SetPlayingPausedTimestampThreadSafe timestamp = new SetPlayingPausedTimestampThreadSafe(queueDao, id, ms);
|
||||||
Thread thread = new Thread(timestamp);
|
Thread thread = new Thread(timestamp);
|
||||||
thread.start();
|
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 QueueDao queueDao;
|
||||||
private final String songId;
|
private final String songId;
|
||||||
private final long ms;
|
private final long ms;
|
||||||
|
|
||||||
public SetPlayingChangedTimestampThreadSafe(QueueDao queueDao, String songId, long ms) {
|
public SetPlayingPausedTimestampThreadSafe(QueueDao queueDao, String songId, long ms) {
|
||||||
this.queueDao = queueDao;
|
this.queueDao = queueDao;
|
||||||
this.songId = songId;
|
this.songId = songId;
|
||||||
this.ms = ms;
|
this.ms = ms;
|
||||||
|
|
|
||||||
|
|
@ -271,8 +271,8 @@ public class MediaManager {
|
||||||
if (mediaItem != null) getQueueRepository().setLastPlayedTimestamp(mediaItem.mediaId);
|
if (mediaItem != null) getQueueRepository().setLastPlayedTimestamp(mediaItem.mediaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPlayingChangedTimestamp(MediaItem mediaItem, long ms) {
|
public static void setPlayingPausedTimestamp(MediaItem mediaItem, long ms) {
|
||||||
if (mediaItem != null) getQueueRepository().setPlayingChangedTimestamp(mediaItem.mediaId, ms);
|
if (mediaItem != null) getQueueRepository().setPlayingPausedTimestamp(mediaItem.mediaId, ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static QueueRepository getQueueRepository() {
|
private static QueueRepository getQueueRepository() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.cappielloantonio.play.service;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.media3.common.AudioAttributes;
|
import androidx.media3.common.AudioAttributes;
|
||||||
|
|
@ -102,7 +101,7 @@ public class MediaService extends MediaLibraryService {
|
||||||
@Override
|
@Override
|
||||||
public void onIsPlayingChanged(boolean isPlaying) {
|
public void onIsPlayingChanged(boolean isPlaying) {
|
||||||
if(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