all: reformat
This commit is contained in:
parent
3ad2fd2fc0
commit
7e45812411
3 changed files with 19 additions and 16 deletions
|
@ -340,7 +340,11 @@ internal class GenreVertex(val preGenre: PreGenre) {
|
|||
}
|
||||
|
||||
internal class PlaylistVertex(val prePlaylist: PrePlaylist) {
|
||||
val songVertices = Array<SongVertex?>(prePlaylist.songPointers.size) { null}
|
||||
val pointerMap = prePlaylist.songPointers.withIndex().associateBy { it.value }.mapValuesTo(mutableMapOf()) { it.value.index }
|
||||
val songVertices = Array<SongVertex?>(prePlaylist.songPointers.size) { null }
|
||||
val pointerMap =
|
||||
prePlaylist.songPointers
|
||||
.withIndex()
|
||||
.associateBy { it.value }
|
||||
.mapValuesTo(mutableMapOf()) { it.value.index }
|
||||
val tag: Any? = null
|
||||
}
|
||||
|
|
|
@ -23,10 +23,8 @@ import org.oxycblt.musikr.MutableLibrary
|
|||
import org.oxycblt.musikr.Playlist
|
||||
import org.oxycblt.musikr.Song
|
||||
import org.oxycblt.musikr.fs.Path
|
||||
import org.oxycblt.musikr.playlist.PlaylistHandle
|
||||
import org.oxycblt.musikr.playlist.db.StoredPlaylists
|
||||
import org.oxycblt.musikr.playlist.interpret.PlaylistInterpreter
|
||||
import org.oxycblt.musikr.playlist.interpret.PostPlaylist
|
||||
import org.oxycblt.musikr.playlist.interpret.PrePlaylistInfo
|
||||
|
||||
internal data class LibraryImpl(
|
||||
|
@ -67,7 +65,8 @@ internal data class LibraryImpl(
|
|||
}
|
||||
|
||||
override suspend fun renamePlaylist(playlist: Playlist, name: String): MutableLibrary {
|
||||
val playlistImpl = requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
val playlistImpl =
|
||||
requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
"Playlist to rename is not in this library"
|
||||
}
|
||||
val prePlaylist = playlistImpl.core.prePlaylist
|
||||
|
@ -79,7 +78,8 @@ internal data class LibraryImpl(
|
|||
}
|
||||
|
||||
override suspend fun addToPlaylist(playlist: Playlist, songs: List<Song>): MutableLibrary {
|
||||
val playlistImpl = requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
val playlistImpl =
|
||||
requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
"Playlist to add to is not in this library"
|
||||
}
|
||||
playlistImpl.core.prePlaylist.handle.add(songs)
|
||||
|
@ -89,7 +89,8 @@ internal data class LibraryImpl(
|
|||
}
|
||||
|
||||
override suspend fun rewritePlaylist(playlist: Playlist, songs: List<Song>): MutableLibrary {
|
||||
val playlistImpl = requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
val playlistImpl =
|
||||
requireNotNull(playlistUidMap[playlist.uid]) {
|
||||
"Playlist to rewrite is not in this library"
|
||||
}
|
||||
playlistImpl.core.prePlaylist.handle.rewrite(songs)
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.oxycblt.musikr.model
|
|||
import org.oxycblt.musikr.Playlist
|
||||
import org.oxycblt.musikr.Song
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
import org.oxycblt.musikr.playlist.interpret.PlaylistInterpreter
|
||||
import org.oxycblt.musikr.playlist.interpret.PrePlaylistInfo
|
||||
import org.oxycblt.musikr.tag.Name
|
||||
|
||||
|
@ -46,5 +45,4 @@ internal class PlaylistImpl(val core: PlaylistCore) : Playlist {
|
|||
override fun hashCode() = hashCode
|
||||
|
||||
override fun toString() = "Playlist(uid=$uid, name=$name)"
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue