diff --git a/app/build.gradle b/app/build.gradle
index 57b14a87fc..bb0b7132e5 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -400,6 +400,8 @@ dependencies {
exclude group: 'com.google.auto.value', module: 'auto-value'
}
implementation 'com.google.zxing:core:3.5.3'
+ implementation 'androidx.media3:media3-exoplayer:1.3.1'
+ implementation 'androidx.media3:media3-session:1.3.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.16.1'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 80c9312fe6..1264c8211a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -141,6 +141,7 @@
+
@@ -334,6 +335,14 @@
android:name=".sync.SyncthingService"
android:exported="false"
android:foregroundServiceType="dataSync" />
+
+
+
+
+
>(emptyList())
+ private var soundtracksLoaded by mutableStateOf(false)
private var gameStoresSpeedTier by mutableStateOf("fast")
private var navRequest by mutableStateOf(null)
private val gameLaunchRequest = java.util.concurrent.atomic.AtomicLong()
@@ -785,6 +789,11 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
private var shortcutPicker by mutableStateOf(false)
private var shortcutLibraryScanning by mutableStateOf(false)
@Volatile private var libraryScanGeneration = 0
+ private class SoundtrackRemoval(val op: Int, var scan: Int, var settled: Boolean)
+ private val soundtrackRemovals = HashMap()
+ private var soundtrackOp = 0
+ private var soundtrackAddScan = -1
+ private val soundtrackWork = java.util.concurrent.Executors.newSingleThreadExecutor { r -> Thread(r, "soundtrack-work").apply { isDaemon = true } }
@Volatile private var lastComponentRestore = 0L
@Volatile private var componentRestoreRetry = false
private val componentRestoreLock = Any()
@@ -847,6 +856,15 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
pendingGameLink = null
gameLinkReading = false
gameLinkTried = false
+ soundtrackLaunch = false
+ val soundtrackId = com.droiddeck.launcher.frontend.SoundtrackShortcuts.read(request)
+ if (soundtrackId != null) {
+ soundtrackLaunch = true
+ navRequest = if (SessionPrefs.soundtracksEnabled(this)) "sound:$soundtrackId" else "app:$soundtrackId"
+ request.data = null
+ request.action = Intent.ACTION_MAIN
+ return
+ }
if (GameLaunchIntent.accepts(request.action)) {
gameLinkReading = true
com.droiddeck.launcher.ui.DualScreenPanel.hide(taskId)
@@ -871,6 +889,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
}
private fun launchGame(game: Library.SteamGame, returnHome: Boolean = false): Boolean {
+ if (!SessionPrefs.soundtracksIngame(this)) com.droiddeck.launcher.playback.SoundtrackController.pause(this)
if (pkgStage != null) {
android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
return false
@@ -1144,6 +1163,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
LauncherIcon.repair(this, intent?.component)
launcherIcon = LauncherIcon.current(this)
gameStoresEnabled = SessionPrefs.gameStoresEnabled(this)
+ soundtracksEnabled = SessionPrefs.soundtracksEnabled(this)
+ soundtracksIngame = SessionPrefs.soundtracksIngame(this)
gameStoresSpeedTier = SessionPrefs.gameStoresSpeedTier(this)
storesShowMature = SessionPrefs.storesShowMature(this)
storesSort = SessionPrefs.storesSort(this)
@@ -1239,6 +1260,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
lowStorageWarning = lowStorageWarning,
launcherIcon = launcherIcon,
gameStoresEnabled = gameStoresEnabled,
+ soundtracksEnabled = soundtracksEnabled,
+ soundtracksIngame = soundtracksIngame,
+ soundtracks = soundtracks,
+ soundtracksLoaded = soundtracksLoaded,
gameStoresSpeedTier = gameStoresSpeedTier,
navigate = navRequest,
addedGamesArt = addedGamesArt,
@@ -1287,7 +1312,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
},
onEpicLauncher = { openEpicLauncher() },
onUninstallEpicLauncher = { uninstallEpicLauncher() },
- onGameShortcut = { g -> com.droiddeck.launcher.frontend.GameShortcuts.pin(this, g) },
+ onGameShortcut = { g ->
+ if (g.soundtrack) com.droiddeck.launcher.frontend.SoundtrackShortcuts.pin(this, g)
+ else com.droiddeck.launcher.frontend.GameShortcuts.pin(this, g)
+ },
onExportGameFile = { g -> pickGameExport(g) },
onSyncGameFiles = { pickGameExport(null) },
onAddGameExe = { path -> addGameExe(path) },
@@ -1312,8 +1340,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
}, "game-file-stop-sync").start()
},
onCopyGameLink = { g ->
- (getSystemService(CLIPBOARD_SERVICE) as ClipboardManager).setPrimaryClip(
- ClipData.newPlainText(g.name, com.droiddeck.launcher.frontend.GameLaunchLink.uri(g.gameIdString)))
+ val link = if (g.soundtrack) com.droiddeck.launcher.frontend.SoundtrackShortcuts.uri(g.appId)
+ else com.droiddeck.launcher.frontend.GameLaunchLink.uri(g.gameIdString)
+ (getSystemService(CLIPBOARD_SERVICE) as ClipboardManager).setPrimaryClip(ClipData.newPlainText(g.name, link))
android.widget.Toast.makeText(this, R.string.game_link_copied, android.widget.Toast.LENGTH_SHORT).show()
},
onDesktop = {
@@ -1338,6 +1367,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
},
onRom = { g ->
val e = emulatorList.first { it.id == g.emulatorId }
+ if (!SessionPrefs.soundtracksIngame(this)) com.droiddeck.launcher.playback.SoundtrackController.pause(this)
startActivity(Intent(this, SessionActivity::class.java)
.putExtra(SessionService.EXTRA_MODE, SessionService.MODE_RUN)
.putExtra(SessionService.EXTRA_PROGRAM, e.program)
@@ -1506,6 +1536,15 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
},
onPageBack = { showPerformance = false; showComponents = false; showMapping = false },
onGameStoresEnabled = { on -> SessionPrefs.setGameStoresEnabled(this, on); gameStoresEnabled = on },
+ onSoundtracksEnabled = { on -> SessionPrefs.setSoundtracksEnabled(this, on); soundtracksEnabled = on },
+ onSoundtracksIngame = { on ->
+ SessionPrefs.setSoundtracksIngame(this, on)
+ soundtracksIngame = on
+ com.droiddeck.launcher.playback.SoundtrackController.setIngame(this, on)
+ },
+ onSoundtrackAdded = { folder -> addSoundtrack(folder) },
+ onSoundtracksChanged = { refreshAddedSoundtracks() },
+ onSoundtrackRemoved = { g -> removeSoundtrack(g) },
onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id },
onLauncherIcon = { style -> switchLauncherIcon(style) },
onLanguage = { tag ->
@@ -1799,7 +1838,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
startSteamAtStartupIfEnabled()
}
+ private var soundtrackLaunch = false
+
private fun startSteamAtStartupIfEnabled(cold: Boolean = false) {
+ if (soundtrackLaunch) return
if (intent.action != Intent.ACTION_MAIN && !(cold && intent.action == null)) return
if (isFinishing || isDestroyed) return
when (SessionPrefs.startupSession(this)) {
@@ -2644,15 +2686,89 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
val version = (steamArtRefreshes[appId] ?: 0) + 1
steamArtRefreshes[appId] = version
Thread({
- val fresh = com.droiddeck.launcher.frontend.Library.steamGames(this).firstOrNull { it.appId == appId } ?: return@Thread
+ val fresh = com.droiddeck.launcher.frontend.Library.steamGames(this, soundtracks = true).firstOrNull { it.appId == appId } ?: return@Thread
ui.post {
if (steamArtRefreshes[appId] != version) return@post
- steamGames = steamGames.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it }
+ if (fresh.soundtrack) soundtracks = soundtracks.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it }
+ else steamGames = steamGames.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it }
}
}, "steam-art-update").start()
}
+ private fun addSoundtrack(folder: java.io.File) {
+ val op = ++soundtrackOp
+ soundtrackAddScan = libraryScanGeneration
+ soundtrackWork.execute {
+ val added = com.droiddeck.launcher.frontend.AddedSoundtracks.add(this, folder)
+ val list = com.droiddeck.launcher.frontend.AddedSoundtracks.games(this)
+ ui.post {
+ if (added) {
+ soundtrackRemovals[folder.path]?.takeIf { it.op < op }?.let {
+ soundtrackRemovals.remove(folder.path)
+ com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(folder.path))
+ }
+ val visible = list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] }?.let { it.op > op } == true }
+ soundtracks = soundtracks.filter { it.library != Library.ADDED } + visible
+ } else android.widget.Toast.makeText(this, R.string.soundtracks_add_empty, android.widget.Toast.LENGTH_SHORT).show()
+ }
+ }
+ }
+
+ private fun refreshAddedSoundtracks() {
+ val op = soundtrackOp
+ soundtrackWork.execute {
+ val list = com.droiddeck.launcher.frontend.AddedSoundtracks.games(this)
+ ui.post {
+ if (op != soundtrackOp) return@post
+ val visible = list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] } != null }
+ soundtracks = soundtracks.filter { it.library != Library.ADDED } + visible
+ }
+ }
+ }
+
+ private fun removeSoundtrack(g: Library.SteamGame) {
+ val path = g.gameFiles?.path
+ val added = g.library == Library.ADDED
+ val target = if (added) null else com.droiddeck.launcher.frontend.GameRemoval.steamFiles(g) ?: return
+ com.droiddeck.launcher.playback.SoundtrackController.stopIf(this, g.gameFiles)
+ val marker = SoundtrackRemoval(++soundtrackOp, libraryScanGeneration, added)
+ path?.let { soundtrackRemovals[it] = marker }
+ if (target == null) {
+ soundtracks = soundtracks.filterNot { it.appId == g.appId && it.library == Library.ADDED }
+ soundtrackWork.execute {
+ val removed = com.droiddeck.launcher.frontend.AddedSoundtracks.remove(this, path.orEmpty())
+ val list = if (removed) emptyList() else com.droiddeck.launcher.frontend.AddedSoundtracks.games(this)
+ if (!removed) ui.post {
+ if (path != null && soundtrackRemovals[path] === marker) {
+ soundtrackRemovals.remove(path)
+ com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(path))
+ }
+ soundtracks = soundtracks.filter { it.library != Library.ADDED } + list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] } != null }
+ android.widget.Toast.makeText(this, getString(R.string.gfiles_remove_failed, g.name), android.widget.Toast.LENGTH_SHORT).show()
+ }
+ }
+ return
+ }
+ soundtrackWork.execute {
+ val deleted = com.droiddeck.launcher.frontend.GameRemoval.delete(target)
+ ui.post {
+ if (deleted) {
+ marker.scan = libraryScanGeneration
+ marker.settled = true
+ } else {
+ if (path != null && soundtrackRemovals[path] === marker) {
+ soundtrackRemovals.remove(path)
+ com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(path))
+ }
+ android.widget.Toast.makeText(this, getString(R.string.gfiles_remove_failed, g.name), android.widget.Toast.LENGTH_SHORT).show()
+ }
+ refresh()
+ }
+ }
+ }
+
private fun removeGame(g: Library.SteamGame) {
+ if (g.soundtrack) { removeSoundtrack(g); return }
val folder = g.gameFiles ?: return
when (com.droiddeck.launcher.frontend.GameRemoval.kind(g)) {
com.droiddeck.launcher.frontend.GameRemoval.Kind.LAUNCHER -> Unit
@@ -2936,6 +3052,19 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
}
val scannedArch = SessionPrefs.activeSteamClientArch(this)
val scannedX64 = scannedArch == "x86_64"
+ val scannedSoundtracks = runCatching {
+ (if (ready || com.droiddeck.launcher.runtime.LinuxRuntime.hasRootfs(this)) Library.soundtracks(this, scannedArch) else emptyList()) +
+ com.droiddeck.launcher.frontend.AddedSoundtracks.games(this)
+ }.getOrDefault(emptyList())
+ ui.post {
+ if (scanGeneration == libraryScanGeneration) {
+ val scanned = if (scanGeneration <= soundtrackAddScan) scannedSoundtracks + soundtracks.filter { cur -> cur.library == Library.ADDED && scannedSoundtracks.none { it.library == Library.ADDED && it.appId == cur.appId } } else scannedSoundtracks
+ val kept = scanned.filterNot { s -> s.gameFiles?.path?.let { p -> soundtrackRemovals[p]?.let { m -> !m.settled || s.library == Library.ADDED || scanGeneration <= m.scan } } == true }
+ com.droiddeck.launcher.playback.SoundtrackController.allow(kept.mapNotNull { it.gameFiles?.path })
+ soundtracks = kept
+ soundtracksLoaded = true
+ }
+ }
val games = if (ready || com.droiddeck.launcher.runtime.LinuxRuntime.hasRootfs(this)) Library.launchableGames(this, arch = scannedArch) else emptyList()
val all = games.distinctBy { it.gameId }
if (ready && scanGeneration == libraryScanGeneration) com.droiddeck.launcher.frontend.LibraryCache.save(this, all, scannedX64)
diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt b/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt
new file mode 100644
index 0000000000..635941cb7a
--- /dev/null
+++ b/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt
@@ -0,0 +1,69 @@
+package com.droiddeck.launcher.frontend
+
+import android.content.Context
+import org.json.JSONArray
+import org.json.JSONObject
+import java.io.File
+
+object AddedSoundtracks {
+ private fun file(context: Context) = File(context.filesDir, "added-soundtracks.json")
+
+ class Entry(val path: String, val name: String, val id: Int = 0)
+
+ internal fun assignIds(list: List): List {
+ val used = list.filter { it.id != 0 }.map { it.id }.toMutableSet()
+ return list.map { e ->
+ if (e.id != 0) e else {
+ var id = idOf(e.path)
+ while (id == 0 || !used.add(id)) id = (id + 1) or Int.MIN_VALUE
+ Entry(e.path, e.name, id)
+ }
+ }
+ }
+
+ @Synchronized
+ fun entries(context: Context): List = runCatching {
+ val f = file(context).takeIf { it.isFile } ?: return emptyList()
+ val array = JSONArray(f.readText())
+ val raw = List(array.length()) { i -> array.getJSONObject(i).let { Entry(it.getString("path"), it.getString("name"), it.optInt("id", 0)) } }
+ val ready = assignIds(raw)
+ if (raw.any { it.id == 0 }) save(context, ready)
+ ready
+ }.getOrDefault(emptyList())
+
+ @Synchronized
+ private fun save(context: Context, list: List): Boolean =
+ runCatching {
+ val array = JSONArray()
+ list.forEach { array.put(JSONObject().put("path", it.path).put("name", it.name).put("id", it.id)) }
+ val f = file(context)
+ val tmp = File(f.path + ".tmp")
+ tmp.writeText(array.toString())
+ if (tmp.renameTo(f)) true else { tmp.delete(); false }
+ }.getOrDefault(false)
+
+ fun add(context: Context, folder: File): Boolean {
+ if (!folder.isDirectory || Soundtrack.audioFiles(folder).isEmpty()) return false
+ return synchronized(this) {
+ val list = entries(context)
+ list.any { it.path == folder.path } || save(context, assignIds(list + Entry(folder.path, folder.name)))
+ }
+ }
+
+ fun remove(context: Context, path: String): Boolean =
+ synchronized(this) { save(context, entries(context).filterNot { it.path == path }) }
+
+ internal fun idOf(path: String): Int = path.hashCode() or Int.MIN_VALUE
+
+ fun games(context: Context): List = entries(context).mapNotNull { e ->
+ val dir = File(e.path).takeIf { it.isDirectory } ?: return@mapNotNull null
+ game(context, e, dir, e.id)
+ }
+
+ private fun game(context: Context, e: Entry, dir: File, id: Int): Library.SteamGame {
+ return Library.SteamGame(
+ appId = id, name = e.name, art = SoundtrackCollectionArt.chosen(context, id) ?: Soundtrack.firstCover(context, dir), library = Library.ADDED, gameId = id.toLong() and 0xFFFFFFFFL,
+ gameFiles = dir, source = Library.ADDED, soundtrack = true,
+ )
+ }
+}
diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt b/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt
index 388448e184..a35c71342b 100644
--- a/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt
+++ b/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt
@@ -21,7 +21,7 @@ object GameRemoval {
fun steamFiles(game: Library.SteamGame): SteamFiles? {
val dir = game.gameFiles ?: return null
val common = dir.parentFile ?: return null
- if (common.name != "common") return null
+ if (common.name != (if (game.soundtrack) "music" else "common")) return null
val steamapps = common.parentFile ?: return null
if (steamapps.name != "steamapps") return null
val manifest = File(steamapps, "appmanifest_${game.appId}.acf")
diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt
index 99732653b6..8acbbe18b0 100644
--- a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt
+++ b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt
@@ -19,9 +19,10 @@ object Library {
val storeId: String? = null,
val logo: File? = null,
val installedAt: Long = 0L,
+ val soundtrack: Boolean = false,
) {
fun withArt(art: File?, hero: File?, icon: File?, logo: File? = this.logo) =
- SteamGame(appId, name, art, library, gameId, hero, lastPlayed, gameFiles, protonPrefix, icon, source, storeId, logo, installedAt)
+ SteamGame(appId, name, art, library, gameId, hero, lastPlayed, gameFiles, protonPrefix, icon, source, storeId, logo, installedAt, soundtrack)
val gameIdString: String get() = java.lang.Long.toUnsignedString(gameId)
val launchKey: String get() = if (storeId != null) "$source:$storeId" else gameIdString
@@ -38,6 +39,7 @@ object Library {
const val BATTLENET_LAUNCHER = "battlenet-launcher"
const val XBOX_CLOUD = "xbox-cloud"
const val SOURCE_STEAM = "steam"
+ const val SOURCE_COLLECTION = "collection"
class Rom(val name: String, val hostPath: File, val guestPath: String, val emulatorId: String, val art: File? = null)
class Emulator(val id: String, val name: String, val system: String, val program: String, val installed: Boolean, val games: List) {
@@ -123,9 +125,12 @@ object Library {
.distinctBy { runCatching { it.canonicalPath }.getOrDefault(it.absolutePath) }
}
+ fun soundtracks(context: Context, arch: String = SessionPrefs.activeSteamClientArch(context)): List =
+ steamGames(context, arch = arch, withShared = false, soundtracks = true, soundtracksOnly = true)
+
fun steamGames(
context: Context, strictRead: Boolean = false, arch: String = SessionPrefs.activeSteamClientArch(context),
- withShared: Boolean = true,
+ withShared: Boolean = true, soundtracks: Boolean = false, soundtracksOnly: Boolean = false,
onlyAppIds: Set? = null,
): List {
val root = SessionPrefs.steamRoot(context, arch)
@@ -146,16 +151,19 @@ object Library {
val name = NAME.find(text)?.groupValues?.get(1)?.trim().orEmpty()
val flags = STATE.find(text)?.groupValues?.get(1)?.toIntOrNull() ?: 0
if (name.isEmpty() || flags and 4 == 0) return@forEach
+ val installDir = INSTALL_DIR.find(text)?.groupValues?.get(1)?.trim()
+ ?.takeIf { it.isNotEmpty() && it != "." && it != ".." && '/' !in it && '\\' !in it }
+ val gameFiles = installDir?.let { File(steamapps, "common/$it").takeIf(File::isDirectory) }
+ val musicFiles = if (gameFiles == null) installDir?.let { File(steamapps, "music/$it").takeIf(File::isDirectory) } else null
+ if (musicFiles != null && !soundtracks) return@forEach
+ if (soundtracksOnly && musicFiles == null) return@forEach
val images = SteamCacheImages(File(cache, appId.toString()))
val art = images.find(STEAM_CAPSULES)
val hero = images.find(STEAM_HEROES)
val lastPlayed = LAST_PLAYED.find(text)?.groupValues?.get(1)?.toLongOrNull() ?: 0L
- val installDir = INSTALL_DIR.find(text)?.groupValues?.get(1)?.trim()
- ?.takeIf { it.isNotEmpty() && it != "." && it != ".." && '/' !in it && '\\' !in it }
- val gameFiles = installDir?.let { File(steamapps, "common/$it").takeIf(File::isDirectory) }
out[appId] = SteamGameArt.withOverrides(context, SteamGame(
- appId, name, art, label, hero = hero, lastPlayed = lastPlayed,
- gameFiles = gameFiles,
+ appId, name, art ?: musicFiles?.let { Soundtrack.firstCover(context, it) }, label, hero = hero, lastPlayed = lastPlayed,
+ gameFiles = gameFiles ?: musicFiles, soundtrack = musicFiles != null,
protonPrefix = protonPrefix(context, appId.toLong(), library, roots),
icon = images.icon(),
logo = images.find(STEAM_LOGOS),
@@ -177,6 +185,7 @@ object Library {
strictRead = strictRead,
arch = other,
withShared = false,
+ soundtracks = soundtracks,
onlyAppIds = shared,
)
} catch (e: Exception) {
diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt b/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt
new file mode 100644
index 0000000000..7f66f20962
--- /dev/null
+++ b/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt
@@ -0,0 +1,308 @@
+package com.droiddeck.launcher.frontend
+
+import android.content.Context
+import android.media.MediaMetadataRetriever
+import org.json.JSONArray
+import org.json.JSONObject
+import java.io.File
+
+object Soundtrack {
+ class Track(
+ val file: File, val title: String, val disc: Int, val number: Int, val durationMs: Long, val artist: String = "",
+ val discLabel: String = disc.toString(),
+ ) {
+ val id: String get() = file.path
+ }
+
+ class Album(val disc: Map>, val artist: String, val cover: File?) {
+ val tracks: List