mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 10:23:33 +00:00
Fixed bulk live download when user chooses to sync starred tracks
This commit is contained in:
parent
3f6f3ab06a
commit
da7030bee1
7 changed files with 60 additions and 14 deletions
|
|
@ -20,9 +20,9 @@ import com.cappielloantonio.play.model.RecentSearch;
|
|||
import com.cappielloantonio.play.model.Server;
|
||||
|
||||
@Database(
|
||||
version = 61,
|
||||
version = 62,
|
||||
entities = {Queue.class, Server.class, RecentSearch.class, Download.class, Chronology.class},
|
||||
autoMigrations = {@AutoMigration(from = 60, to = 61)}
|
||||
autoMigrations = {@AutoMigration(from = 61, to = 62)}
|
||||
)
|
||||
@TypeConverters({DateConverters.class})
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
|
||||
@Dao
|
||||
public interface DownloadDao {
|
||||
@Query("SELECT * FROM download ORDER BY album, track ASC")
|
||||
@Query("SELECT * FROM download WHERE download_state = 1 ORDER BY artist, album, track ASC")
|
||||
LiveData<List<Download>> getAll();
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
|
|
@ -21,6 +21,9 @@ public interface DownloadDao {
|
|||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(List<Download> downloads);
|
||||
|
||||
@Query("UPDATE download SET download_state = 1 WHERE id = :id")
|
||||
void update(String id);
|
||||
|
||||
@Query("DELETE FROM download WHERE id = :id")
|
||||
void delete(String id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue