mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Removed unused methods from song repository
This commit is contained in:
parent
4a02a49ac1
commit
ff1f4ef106
3 changed files with 235 additions and 383 deletions
|
|
@ -18,9 +18,6 @@ public interface SongDao {
|
|||
@Query("SELECT * FROM song")
|
||||
LiveData<List<Song>> getAll();
|
||||
|
||||
@Query("SELECT * FROM song WHERE id = :id")
|
||||
LiveData<Song> getOne(String id);
|
||||
|
||||
@Query("SELECT * FROM song")
|
||||
List<Song> getAllList();
|
||||
|
||||
|
|
@ -36,22 +33,18 @@ public interface SongDao {
|
|||
@Query("SELECT * FROM song WHERE play_count != 0 ORDER BY play_count DESC LIMIT :number")
|
||||
LiveData<List<Song>> getMostPlayedSample(int number);
|
||||
|
||||
// @Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY play_count DESC LIMIT :number")
|
||||
@Query("SELECT song.* FROM song INNER JOIN song_artist_cross ON song.id = song_artist_cross.song_id AND song_artist_cross.artist_id = :artistID ORDER BY play_count DESC LIMIT :number")
|
||||
LiveData<List<Song>> getArtistTopSongsSample(String artistID, int number);
|
||||
|
||||
// @Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY play_count DESC")
|
||||
@Query("SELECT song.* FROM song INNER JOIN song_artist_cross ON song.id = song_artist_cross.song_id AND song_artist_cross.artist_id = :artistID ORDER BY play_count DESC")
|
||||
LiveData<List<Song>> getArtistTopSongs(String artistID);
|
||||
|
||||
// @Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY RANDOM() LIMIT :number")
|
||||
@Query("SELECT song.* FROM song INNER JOIN song_artist_cross ON song.id = song_artist_cross.song_id AND song_artist_cross.artist_id = :artistID ORDER BY RANDOM() LIMIT :number")
|
||||
List<Song> getArtistRandomSongs(String artistID, int number);
|
||||
|
||||
@Query("SELECT * FROM song WHERE albumId = :albumID ORDER BY trackNumber ASC")
|
||||
LiveData<List<Song>> getLiveAlbumSong(String albumID);
|
||||
|
||||
// @Query("SELECT * FROM song WHERE albumId = :albumID ORDER BY trackNumber ASC")
|
||||
@Query("SELECT song.* FROM song INNER JOIN playlist_song_cross ON song.id = playlist_song_cross.song_id AND playlist_song_cross.playlist_id = :playlistID")
|
||||
LiveData<List<Song>> getLivePlaylistSong(String playlistID);
|
||||
|
||||
|
|
@ -70,33 +63,15 @@ public interface SongDao {
|
|||
@Query("SELECT * FROM song WHERE favorite = 1")
|
||||
LiveData<List<Song>> getFavoriteSong();
|
||||
|
||||
@Query("SELECT * FROM song WHERE id = :id")
|
||||
Song getSongByID(String id);
|
||||
|
||||
@Query("SELECT EXISTS(SELECT * FROM song WHERE id = :id)")
|
||||
boolean exist(String id);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(Song song);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(List<Song> songs);
|
||||
|
||||
@Delete
|
||||
void delete(Song song);
|
||||
|
||||
@Query("DELETE FROM song")
|
||||
void deleteAll();
|
||||
|
||||
@Update
|
||||
void update(Song song);
|
||||
|
||||
@Query("UPDATE song SET play_count = :playCount AND last_play = :lastPlay WHERE id = :id")
|
||||
void updatePlayCount(String id, int playCount, long lastPlay);
|
||||
|
||||
@Query("UPDATE song SET favorite = :isFavorite WHERE id = :id")
|
||||
void updateFavorite(String id, boolean isFavorite);
|
||||
|
||||
@Query("SELECT * FROM song WHERE id IN (:ids)")
|
||||
List<Song> getSongsByID(List<String> ids);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue