mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Implementation of download navigation for artists and albums
This commit is contained in:
parent
c5f39cf9ee
commit
86d46f7537
16 changed files with 98 additions and 53 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue