Code refactor

This commit is contained in:
Hemanth S 2020-08-21 17:42:40 +05:30
parent a7e55cc5bf
commit b54c561070
2 changed files with 5 additions and 4 deletions

View file

@ -32,6 +32,9 @@ interface PlaylistDao {
@Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistId") @Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistId")
suspend fun getSongs(playlistId: Int): List<SongEntity> suspend fun getSongs(playlistId: Int): List<SongEntity>
@Query("DELETE FROM SongEntity WHERE playlist_creator_id = :playlistId AND id = :songId")
fun removeSong(playlistId: Int, songId: Int)
@Delete @Delete
suspend fun deletePlaylistEntity(playlistEntity: PlaylistEntity) suspend fun deletePlaylistEntity(playlistEntity: PlaylistEntity)
@ -40,7 +43,5 @@ interface PlaylistDao {
@Delete @Delete
suspend fun removeSongsFromPlaylist(songs: List<SongEntity>) suspend fun removeSongsFromPlaylist(songs: List<SongEntity>)
@Query("DELETE FROM SongEntity WHERE playlist_creator_id = :playlistId AND id = :songId")
fun removeSong(playlistId: Int, songId: Int)
} }

View file

@ -270,7 +270,7 @@ abstract class AbsPlayerFragment(@LayoutRes layout: Int) : AbsMainActivityFragme
protected fun getUpNextAndQueueTime(): String { protected fun getUpNextAndQueueTime(): String {
val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position) val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position)
return MusicUtil.buildInfoString( return MusicUtil.buildInfoString(
resources.getString(R.string.up_next), resources.getString(R.string.up_next),
MusicUtil.getReadableDurationString(duration) MusicUtil.getReadableDurationString(duration)