added db function to retrieve pseudo random elements

This commit is contained in:
CappielloAntonio 2021-04-20 14:18:40 +02:00
parent 8e3456078b
commit 717986ea2c

View file

@ -24,7 +24,8 @@ 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)")
// Da utilizzare in caso si decidesse di migliorare il viewpager nella home
@Query("SELECT * FROM song WHERE id IN (:pseudoRandomNumber)")
LiveData<List<Song>> getDiscoverySample(List<Integer> pseudoRandomNumber);
@Query("SELECT * FROM song ORDER BY added DESC LIMIT :number")