Fixed bulk live download when user chooses to sync starred tracks
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user