From 27164c05c73b4d3a76a2ad230350372711fa7333 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Wed, 19 Jul 2023 19:51:45 +0200 Subject: [PATCH] Fix names of music plugin again --- .../src/main/kotlin/dev/schlaubi/mikmusic/util/TrackUtil.kt | 4 +++- .../main/kotlin/dev/schlaubi/mikmusic/util/VideoFormatter.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/TrackUtil.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/TrackUtil.kt index 6add882bd..5b6e5ed63 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/TrackUtil.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/util/TrackUtil.kt @@ -1,6 +1,8 @@ package dev.schlaubi.mikmusic.util import dev.arbjerg.lavalink.protocol.v4.Track +import kotlin.time.DurationUnit +import kotlin.time.toDuration /** * Formats a simple message for a [Track]. @@ -8,7 +10,7 @@ import dev.arbjerg.lavalink.protocol.v4.Track * @param repeat whether to add the repeat emoji or not */ fun Track.format(repeat: Boolean = false) = with(info) { - "$title - $author ($length)".run { + "[`$title - $author`]($uri) (${length.toDuration(DurationUnit.MILLISECONDS)})".run { if (repeat) { "🔂 $this" } else { 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 ef8ca6ad4..7e5e14ffa 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 @@ -29,7 +29,7 @@ suspend fun EmbedBuilder.addSong(commandContext: CommandContext, track: Track) = suspend fun EmbedBuilder.addSong(translate: Translator, track: Track) { field { name = translate("music.track.title", "music") - value = track.info.title + value = "[${track.info.title}](${track.info.uri})" } field {