mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Fix filtering
This commit is contained in:
parent
76037e487b
commit
4848d4f3d0
25 changed files with 575 additions and 124 deletions
|
|
@ -10,6 +10,7 @@ import androidx.room.Update;
|
|||
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Dao
|
||||
|
|
@ -44,6 +45,9 @@ public interface SongDao {
|
|||
@Query("SELECT * FROM song INNER Join song_genre_cross ON song.id = song_genre_cross.song_id AND song_genre_cross.genre_id = :genreID")
|
||||
LiveData<List<Song>> getSongByGenre(String genreID);
|
||||
|
||||
@Query("SELECT * FROM song INNER Join song_genre_cross ON song.id = song_genre_cross.song_id AND song_genre_cross.genre_id IN (:filters) GROUP BY song.id")
|
||||
LiveData<List<Song>> getFilteredSong(ArrayList<String> filters);
|
||||
|
||||
@Query("SELECT EXISTS(SELECT * FROM song WHERE id = :id)")
|
||||
boolean exist(String id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue