Code refactor
This commit is contained in:
parent
bcb8f1b42b
commit
6aa9b08ff2
7 changed files with 14 additions and 8 deletions
|
@ -2,8 +2,8 @@ package code.name.monkey.retromusic
|
||||||
|
|
||||||
import code.name.monkey.retromusic.db.PlaylistDatabase
|
import code.name.monkey.retromusic.db.PlaylistDatabase
|
||||||
import code.name.monkey.retromusic.db.PlaylistWithSongs
|
import code.name.monkey.retromusic.db.PlaylistWithSongs
|
||||||
import code.name.monkey.retromusic.db.RealRoomPlaylistRepository
|
import code.name.monkey.retromusic.repository.RealRoomPlaylistRepository
|
||||||
import code.name.monkey.retromusic.db.RoomPlaylistRepository
|
import code.name.monkey.retromusic.repository.RoomPlaylistRepository
|
||||||
import code.name.monkey.retromusic.fragments.LibraryViewModel
|
import code.name.monkey.retromusic.fragments.LibraryViewModel
|
||||||
import code.name.monkey.retromusic.fragments.albums.AlbumDetailsViewModel
|
import code.name.monkey.retromusic.fragments.albums.AlbumDetailsViewModel
|
||||||
import code.name.monkey.retromusic.fragments.artists.ArtistDetailsViewModel
|
import code.name.monkey.retromusic.fragments.artists.ArtistDetailsViewModel
|
||||||
|
|
|
@ -24,6 +24,9 @@ interface PlaylistDao {
|
||||||
@Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistName AND id = :songId")
|
@Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistName AND id = :songId")
|
||||||
suspend fun checkSongExistsWithPlaylistName(playlistName: String, songId: Int): List<SongEntity>
|
suspend fun checkSongExistsWithPlaylistName(playlistName: String, songId: Int): List<SongEntity>
|
||||||
|
|
||||||
@Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistId ORDER BY song_key")
|
@Query("SELECT * FROM SongEntity WHERE playlist_creator_id = :playlistId ORDER BY title")
|
||||||
suspend fun getSongs(playlistId: Int): List<SongEntity>
|
suspend fun getSongs(playlistId: Int): List<SongEntity>
|
||||||
|
|
||||||
|
@Delete
|
||||||
|
suspend fun deletePlaylistEntity(playlistWithSongs: PlaylistWithSongs)
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.db.PlaylistEntity
|
import code.name.monkey.retromusic.db.PlaylistEntity
|
||||||
import code.name.monkey.retromusic.db.RoomPlaylistRepository
|
import code.name.monkey.retromusic.repository.RoomPlaylistRepository
|
||||||
import code.name.monkey.retromusic.db.SongEntity
|
import code.name.monkey.retromusic.db.SongEntity
|
||||||
import code.name.monkey.retromusic.extensions.colorButtons
|
import code.name.monkey.retromusic.extensions.colorButtons
|
||||||
import code.name.monkey.retromusic.extensions.extraNotNull
|
import code.name.monkey.retromusic.extensions.extraNotNull
|
||||||
|
|
|
@ -8,7 +8,7 @@ import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.db.PlaylistEntity
|
import code.name.monkey.retromusic.db.PlaylistEntity
|
||||||
import code.name.monkey.retromusic.db.RoomPlaylistRepository
|
import code.name.monkey.retromusic.repository.RoomPlaylistRepository
|
||||||
import code.name.monkey.retromusic.extensions.colorButtons
|
import code.name.monkey.retromusic.extensions.colorButtons
|
||||||
import code.name.monkey.retromusic.extensions.materialDialog
|
import code.name.monkey.retromusic.extensions.materialDialog
|
||||||
import code.name.monkey.retromusic.fragments.LibraryViewModel
|
import code.name.monkey.retromusic.fragments.LibraryViewModel
|
||||||
|
|
|
@ -10,7 +10,7 @@ import androidx.navigation.ui.NavigationUI
|
||||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity.getToolbarBackgroundColor
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity.getToolbarBackgroundColor
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.db.RoomPlaylistRepository
|
import code.name.monkey.retromusic.repository.RoomPlaylistRepository
|
||||||
import code.name.monkey.retromusic.dialogs.AddToRetroPlaylist
|
import code.name.monkey.retromusic.dialogs.AddToRetroPlaylist
|
||||||
import code.name.monkey.retromusic.extensions.findNavController
|
import code.name.monkey.retromusic.extensions.findNavController
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
||||||
|
|
|
@ -17,7 +17,6 @@ package code.name.monkey.retromusic.repository
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import code.name.monkey.retromusic.*
|
import code.name.monkey.retromusic.*
|
||||||
import code.name.monkey.retromusic.db.PlaylistWithSongs
|
import code.name.monkey.retromusic.db.PlaylistWithSongs
|
||||||
import code.name.monkey.retromusic.db.RoomPlaylistRepository
|
|
||||||
import code.name.monkey.retromusic.model.*
|
import code.name.monkey.retromusic.model.*
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.NotPlayedPlaylist
|
import code.name.monkey.retromusic.model.smartplaylist.NotPlayedPlaylist
|
||||||
import code.name.monkey.retromusic.network.LastFMService
|
import code.name.monkey.retromusic.network.LastFMService
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package code.name.monkey.retromusic.db
|
package code.name.monkey.retromusic.repository
|
||||||
|
|
||||||
import androidx.annotation.WorkerThread
|
import androidx.annotation.WorkerThread
|
||||||
|
import code.name.monkey.retromusic.db.PlaylistDao
|
||||||
|
import code.name.monkey.retromusic.db.PlaylistEntity
|
||||||
|
import code.name.monkey.retromusic.db.PlaylistWithSongs
|
||||||
|
import code.name.monkey.retromusic.db.SongEntity
|
||||||
|
|
||||||
|
|
||||||
interface RoomPlaylistRepository {
|
interface RoomPlaylistRepository {
|
Loading…
Reference in a new issue