mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
Modified sql queries used to retrieving downloaded artists and albums
This commit is contained in:
parent
7d6ad5737f
commit
ac584974c6
4 changed files with 15 additions and 20 deletions
|
|
@ -10,7 +10,6 @@ import com.cappielloantonio.play.database.dao.DownloadDao;
|
|||
import com.cappielloantonio.play.model.Download;
|
||||
import com.cappielloantonio.play.util.PreferenceUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DownloadRepository {
|
||||
|
|
@ -27,8 +26,11 @@ public class DownloadRepository {
|
|||
return downloadDao.getAll(PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
}
|
||||
|
||||
public LiveData<List<Download>> getLiveDownloadSample(int size) {
|
||||
return downloadDao.getSample(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
public LiveData<List<Download>> getLiveDownloadSample(int size, boolean isArtist, boolean isAlbum, boolean isTrack) {
|
||||
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 return downloadDao.getSample(size, PreferenceUtil.getInstance(App.getInstance()).getServerId());
|
||||
}
|
||||
|
||||
public LiveData<List<Download>> getLiveDownloadFromArtist(String artistId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue