mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 07:03:35 +00:00
Implementation of download navigation for artists and albums
This commit is contained in:
@@ -15,7 +15,7 @@ import com.cappielloantonio.play.model.Queue;
|
||||
import com.cappielloantonio.play.model.RecentSearch;
|
||||
import com.cappielloantonio.play.model.Server;
|
||||
|
||||
@Database(entities = {Queue.class, Server.class, RecentSearch.class, Download.class}, version = 15, exportSchema = false)
|
||||
@Database(entities = {Queue.class, Server.class, RecentSearch.class, Download.class}, version = 16, exportSchema = false)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
private static final String TAG = "AppDatabase";
|
||||
|
||||
|
||||
@@ -12,12 +12,18 @@ import java.util.List;
|
||||
|
||||
@Dao
|
||||
public interface DownloadDao {
|
||||
@Query("SELECT * FROM download")
|
||||
List<Download> getAll();
|
||||
@Query("SELECT * FROM download WHERE server=:server")
|
||||
LiveData<List<Download>> getAll(String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server LIMIT :size")
|
||||
LiveData<List<Download>> getSample(int size, String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server AND artistId=:artistId")
|
||||
LiveData<List<Download>> getAllFromArtist(String server, String artistId);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server AND albumId=:albumId")
|
||||
LiveData<List<Download>> getAllFromAlbum(String server, String albumId);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(Download download);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user