mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Saved the playback position when the player is paused
This commit is contained in:
parent
e4d09f3bc0
commit
40866a2855
7 changed files with 101 additions and 13 deletions
|
|
@ -3,6 +3,7 @@ package com.cappielloantonio.play.database;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.room.AutoMigration;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
|
|
@ -20,9 +21,9 @@ import com.cappielloantonio.play.model.Server;
|
|||
|
||||
@SuppressLint("RestrictedApi")
|
||||
@Database(
|
||||
version = 29,
|
||||
entities = {Queue.class, Server.class, RecentSearch.class, Download.class, Playlist.class}
|
||||
// autoMigrations = { @AutoMigration(from = 23, to = 24) }
|
||||
version = 30,
|
||||
entities = {Queue.class, Server.class, RecentSearch.class, Download.class, Playlist.class},
|
||||
autoMigrations = { @AutoMigration(from = 29, to = 30) }
|
||||
)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
private static final String TAG = "AppDatabase";
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ public interface QueueDao {
|
|||
@Query("UPDATE queue SET last_play=:timestamp WHERE id=:id")
|
||||
void setLastPlay(String id, long timestamp);
|
||||
|
||||
@Query("UPDATE queue SET playing_changed=:timestamp WHERE id=:id")
|
||||
void setPlayingChanged(String id, long timestamp);
|
||||
|
||||
@Query("SELECT track_order FROM queue ORDER BY last_play DESC LIMIT 1")
|
||||
int getLastPlay();
|
||||
|
||||
@Query("SELECT playing_changed FROM queue ORDER BY last_play DESC LIMIT 1")
|
||||
long getLastPlayedTimestamp();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue