Implementation of download navigation for artists and albums

This commit is contained in:
CappielloAntonio 2021-08-30 12:38:43 +02:00
parent c5f39cf9ee
commit 86d46f7537
16 changed files with 98 additions and 53 deletions

View file

@ -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);