all: reformat

This commit is contained in:
Alexander Capehart 2024-12-17 12:18:18 -05:00
parent 3ad2fd2fc0
commit 7e45812411
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
3 changed files with 19 additions and 16 deletions

View file

@ -341,6 +341,10 @@ 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 pointerMap =
prePlaylist.songPointers
.withIndex()
.associateBy { it.value }
.mapValuesTo(mutableMapOf()) { it.value.index }
val tag: Any? = null
}

View file

@ -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)

View file

@ -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)"
}