mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Download entire playlists in separate section
This commit is contained in:
parent
f89f3454c4
commit
d2a80c064c
23 changed files with 367 additions and 79 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 = 17, exportSchema = false)
|
||||
@Database(entities = {Queue.class, Server.class, RecentSearch.class, Download.class}, version = 23, exportSchema = false)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
private static final String TAG = "AppDatabase";
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,15 @@ public interface DownloadDao {
|
|||
@Query("SELECT * FROM download WHERE server=:server")
|
||||
LiveData<List<Download>> getAll(String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server GROUP BY artistName LIMIT :size")
|
||||
@Query("SELECT * FROM download WHERE server=:server AND playlistId IS NULL GROUP BY artistName LIMIT :size")
|
||||
LiveData<List<Download>> getSampleArtist(int size, String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server GROUP BY albumName LIMIT :size")
|
||||
@Query("SELECT * FROM download WHERE server=:server AND playlistId IS NULL GROUP BY albumName LIMIT :size")
|
||||
LiveData<List<Download>> getSampleAlbum(int size, String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server AND playlistId IS NOT NULL GROUP BY playlistId LIMIT :size")
|
||||
LiveData<List<Download>> getSamplePlaylist(int size, String server);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server LIMIT :size")
|
||||
LiveData<List<Download>> getSample(int size, String server);
|
||||
|
||||
|
|
@ -30,14 +33,20 @@ public interface DownloadDao {
|
|||
@Query("SELECT * FROM download WHERE server=:server AND albumId=:albumId")
|
||||
LiveData<List<Download>> getAllFromAlbum(String server, String albumId);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server AND playlistId=:playlistId")
|
||||
LiveData<List<Download>> getAllFromPlaylist(String server, String playlistId);
|
||||
|
||||
@Query("SELECT * FROM download WHERE server=:server AND playlistId IS NOT NULL GROUP BY playlistId")
|
||||
LiveData<List<Download>> getAllPlaylists(String server);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(Download download);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(List<Download> downloads);
|
||||
|
||||
@Query("DELETE FROM download WHERE id = :id")
|
||||
void delete(String id);
|
||||
@Query("DELETE FROM download WHERE songId = :songId")
|
||||
void delete(String songId);
|
||||
|
||||
@Query("DELETE FROM download WHERE server=:server")
|
||||
void deleteAll(String server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue