All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ExtendedTrack.kt Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
package dev.schlaubi.lavakord.plugins.lavasrc

import dev.arbjerg.lavalink.protocol.v4.Playlist
import dev.arbjerg.lavalink.protocol.v4.Track
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.decodeFromJsonElement

/**
 * Provides the [ExtendedPlaylistInfo] for this [Playlist].
 */
public val Track.lavaSrcInfo: ExtendedAudioTrack
    get() = json.decodeFromJsonElement(JsonObject(pluginInfo))

/**
 * The extended audio track provided by LavaSrc.
 *
 * @property albumName The name of the album of the track
 * @property artistArtworkUrl the url to the song's artist's artowrk
 * @property previewUrl the url of a preview of the song
 * @property isPreview if this song is a preview
 */
@Serializable
public data class ExtendedAudioTrack(
    val albumName: String,
    val artistArtworkUrl: String,
    val previewUrl: String,
    val isPreview: Boolean
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy