From b54c5610705f5f49f46c6d54018515cf47508dd1 Mon Sep 17 00:00:00 2001 From: Hemanth S Date: Fri, 21 Aug 2020 17:42:40 +0530 Subject: [PATCH] Code refactor --- .../java/code/name/monkey/retromusic/db/PlaylistDao.kt | 7 ++++--- .../monkey/retromusic/fragments/base/AbsPlayerFragment.kt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/db/PlaylistDao.kt b/app/src/main/java/code/name/monkey/retromusic/db/PlaylistDao.kt index dcd90602..fd3d6b43 100644 --- a/app/src/main/java/code/name/monkey/retromusic/db/PlaylistDao.kt +++ b/app/src/main/java/code/name/monkey/retromusic/db/PlaylistDao.kt @@ -32,6 +32,9 @@ interface PlaylistDao { @Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistId") suspend fun getSongs(playlistId: Int): List + @Query("DELETE FROM SongEntity WHERE playlist_creator_id = :playlistId AND id = :songId") + fun removeSong(playlistId: Int, songId: Int) + @Delete suspend fun deletePlaylistEntity(playlistEntity: PlaylistEntity) @@ -40,7 +43,5 @@ interface PlaylistDao { @Delete suspend fun removeSongsFromPlaylist(songs: List) - - @Query("DELETE FROM SongEntity WHERE playlist_creator_id = :playlistId AND id = :songId") - fun removeSong(playlistId: Int, songId: Int) + } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt index 24a63690..6cffd1f1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt @@ -270,7 +270,7 @@ abstract class AbsPlayerFragment(@LayoutRes layout: Int) : AbsMainActivityFragme protected fun getUpNextAndQueueTime(): String { val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position) - + return MusicUtil.buildInfoString( resources.getString(R.string.up_next), MusicUtil.getReadableDurationString(duration)