From 720063806baed6bddd416483a438601071f657b4 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Mon, 14 Aug 2023 23:18:09 +0200 Subject: [PATCH] Add album to track info --- music/build.gradle.kts | 2 +- .../dev/schlaubi/mikmusic/util/VideoFormatter.kt | 11 +++++++++++ .../translations/music/strings_de_DE.properties | 1 + .../translations/music/strings_en_GB.properties | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/music/build.gradle.kts b/music/build.gradle.kts index 03717a872..e137221f0 100644 --- a/music/build.gradle.kts +++ b/music/build.gradle.kts @@ -1,3 +1,3 @@ subprojects { - version = "3.1.5-SNAPSHOT" + version = "3.1.6-SNAPSHOT" } diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/VideoFormatter.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/VideoFormatter.kt index 82dcabf9b..864279d4a 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/VideoFormatter.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/VideoFormatter.kt @@ -74,5 +74,16 @@ suspend fun EmbedBuilder.addSong(translate: Translator, track: Track) { } } } + + if (lavaSrcInfo?.albumName != null) { + field { + name = translate("music.track.album", "music") + value = if (lavaSrcInfo.albumUrl != null) { + "[${lavaSrcInfo.albumName}](${lavaSrcInfo.albumUrl})" + } else { + lavaSrcInfo.albumName!! + } + } + } } } diff --git a/music/player/src/main/resources/translations/music/strings_de_DE.properties b/music/player/src/main/resources/translations/music/strings_de_DE.properties index 6c3457d48..b0ff101c4 100644 --- a/music/player/src/main/resources/translations/music/strings_de_DE.properties +++ b/music/player/src/main/resources/translations/music/strings_de_DE.properties @@ -161,3 +161,4 @@ commands.radio.arguments.query.description=The query you want to start a radio f commands.radio.description=Startet ein Song-Radio commands.radio.invalid_vide=Song-radios funktionieren leider nicht für diesen song. commands.radio.queued=Du hast erfolgreich ein Radio gestartet. +music.track.album=Album diff --git a/music/player/src/main/resources/translations/music/strings_en_GB.properties b/music/player/src/main/resources/translations/music/strings_en_GB.properties index d2704be83..a0ed0c7af 100644 --- a/music/player/src/main/resources/translations/music/strings_en_GB.properties +++ b/music/player/src/main/resources/translations/music/strings_en_GB.properties @@ -165,3 +165,4 @@ commands.radio.arguments.query.description=The query you want to start a radio f commands.radio.description=Starts a song radio commands.radio.invalid_vide=Song radios aren't supported for this song commands.radio.queued=Successfully started a radio. +music.track.album=Album