mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +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
|
|
@ -26,10 +26,11 @@ public class DownloadRepository {
|
|||
return downloadDao.getAll(PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
}
|
||||
|
||||
public LiveData<List<Download>> getLiveDownloadSample(int size, boolean isArtist, boolean isAlbum, boolean isTrack) {
|
||||
public LiveData<List<Download>> getLiveDownloadSample(int size, boolean isArtist, boolean isAlbum, boolean isTrack, boolean isPlaylist) {
|
||||
if (isArtist) return downloadDao.getSampleArtist(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
else if (isAlbum) return downloadDao.getSampleAlbum(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
else if (isTrack) return downloadDao.getSample(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
else if (isPlaylist) return downloadDao.getSamplePlaylist(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
else return downloadDao.getSample(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
}
|
||||
|
||||
|
|
@ -41,6 +42,14 @@ public class DownloadRepository {
|
|||
return downloadDao.getAllFromAlbum(PreferenceUtil.getInstance(App.getInstance()).getServerId(), albumId);
|
||||
}
|
||||
|
||||
public LiveData<List<Download>> getLiveDownloadFromPlaylist(String playlistId) {
|
||||
return downloadDao.getAllFromPlaylist(PreferenceUtil.getInstance(App.getInstance()).getServerId(), playlistId);
|
||||
}
|
||||
|
||||
public LiveData<List<Download>> getLivePlaylist() {
|
||||
return downloadDao.getAllPlaylists(PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
}
|
||||
|
||||
public void insert(Download download) {
|
||||
InsertThreadSafe insert = new InsertThreadSafe(downloadDao, download);
|
||||
Thread thread = new Thread(insert);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue