added db function to retrieve pseudo random elements

This commit is contained in:
CappielloAntonio 2021-04-20 14:16:09 +02:00
parent 40e9a6f778
commit 8e3456078b
2 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,9 @@ public interface SongDao {
@Query("SELECT * FROM song WHERE title LIKE '%' || :title || '%'")
LiveData<List<Song>> searchSong(String title);
@Query("SELECT * FROM song WHERE key IN (:pseudoRandomNumber)")
LiveData<List<Song>> getDiscoverySample(List<Integer> pseudoRandomNumber);
@Query("SELECT * FROM song ORDER BY added DESC LIMIT :number")
LiveData<List<Song>> getRecentlyAddedSample(int number);