Skip to content

Commit

Permalink
Merge branch 'dev' into patch/track-user-data-docs
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/docs-pr.yml
#	docs/api/rest.md
#	docs/index.md
#	docs/stylesheets/style.css
  • Loading branch information
topi314 committed Dec 2, 2023
2 parents 8fcf604 + c2b6b09 commit 3adf2d4
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
mkdocs-material-
- run: pip install -r requirements.txt
working-directory: docs
- run: mkdocs build --verbose --strict
# - run: mkdocs build --verbose --strict
- run: mkdocs build --verbose
working-directory: docs
- uses: actions/upload-pages-artifact@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion LavalinkServer/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ USER lavalink

COPY LavalinkServer/build/libs/Lavalink.jar Lavalink.jar

ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-Xmx4G", "-jar", "Lavalink.jar"]
ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-jar", "Lavalink.jar"]
2 changes: 1 addition & 1 deletion LavalinkServer/docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ USER lavalink

COPY LavalinkServer/build/libs/Lavalink-musl.jar Lavalink.jar

ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-Xmx4G", "-jar", "Lavalink.jar"]
ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-jar", "Lavalink.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class PluginManager(val config: PluginsConfig) {

var repository = declaration.repository
?: if (declaration.snapshot) config.defaultPluginSnapshotRepository else config.defaultPluginRepository
repository =
if (declaration.repository!!.endsWith("/")) declaration.repository!! else declaration.repository!! + "/"
repository = if (repository.endsWith("/")) repository else "$repository/"
Declaration(fragments[0], fragments[1], fragments[2], repository)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.springframework.context.annotation.Configuration

@Configuration
@ConfigurationProperties(prefix = "logging.request")
@ConditionalOnProperty("logging.request.enabled")
@ConditionalOnProperty("logging.request.enabled", matchIfMissing = true)
data class RequestLoggingConfig(
var includeClientInfo: Boolean = true,
var includeClientInfo: Boolean = false,
var includeHeaders: Boolean = false,
var includeQueryString: Boolean = true,
var includePayload: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,9 @@ class SocketContext(
override fun gatewayReady(target: InetSocketAddress?, ssrc: Int) {
SocketServer.sendPlayerUpdate(this@SocketContext, player)
}

override fun gatewayError(cause: Throwable) {
log.error("Koe encountered a voice gateway exception for guild ${player.guildId}", cause)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class PlayerRestHandler(
}

playerUpdate.voice.ifPresent {
//discord sometimes send a partial server update missing the endpoint, which can be ignored.
// Discord sometimes sends a partial voice server update missing the endpoint, which can be ignored.
if (it.endpoint.isEmpty() || it.token.isEmpty() || it.sessionId.isEmpty()) {
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Partial voice state update: $it")
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Partial Lavalink voice state: $it")
}
}

Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ allprojects {
mavenCentral() // main maven repo
mavenLocal() // useful for developing
maven("https://m2.dv8tion.net/releases")
maven("https://maven.arbjerg.dev/releases")
maven("https://maven.lavalink.dev/releases")
jcenter()
maven("https://jitpack.io") // build projects directly from GitHub
}
Expand All @@ -51,8 +51,8 @@ subprojects {
configure<PublishingExtension> {
if (findProperty("MAVEN_PASSWORD") != null && findProperty("MAVEN_USERNAME") != null) {
repositories {
val snapshots = "https://maven.arbjerg.dev/snapshots"
val releases = "https://maven.arbjerg.dev/releases"
val snapshots = "https://maven.lavalink.dev/snapshots"
val releases = "https://maven.lavalink.dev/releases"

maven(if ((version as String).endsWith("-SNAPSHOT")) releases else snapshots) {
credentials {
Expand All @@ -62,7 +62,7 @@ subprojects {
}
}
} else {
logger.lifecycle("Not publishing to maven.arbjerg.dev because credentials are not set")
logger.lifecycle("Not publishing to maven.lavalink.dev because credentials are not set")
}
}
configure<MavenPublishBaseExtension> {
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ hide:
url: api/rest.md
- title: Statistics
icon: ':octicons-graph-16:'
url: api/rest.html#get-lavalink-stats
url: api/rest.md#get-lavalink-stats
- title: Basic authentication
icon: ':material-lock:'
url: api/rest.html
url: api/rest.md
- title: Prometheus metrics
icon: ':simple-prometheus:'
url: https://prometheus.io/
Expand Down
5 changes: 5 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "base.html" %}

{% block announce %}
The Lavalink docs are currently a work in progress. You can give us feedback on <a href="https://github.com/lavalink-devs/Lavalink">GitHub</a>
{% endblock %}
15 changes: 15 additions & 0 deletions docs/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
--md-primary-fg-color--dark: #b25d09;

--md-accent-fg-color: #c24734;

@media screen {
[data-md-color-scheme="slate"] {
--md-default-fg-color: hsla(var(--md-hue), 15%, 90%, 1);
}
}
}

.md-tabs__link {
opacity: 1;
font-weight: bold;
}

.md-tabs__item.md-tabs__item--active {
border-bottom: 4px solid var(--md-default-fg-color);
}

.container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,19 @@ data class Playlist(
val info: PlaylistInfo,
val pluginInfo: JsonObject,
val tracks: List<Track>
) : LoadResult.Data
) : LoadResult.Data {

/**
* Deserialize the plugin info into a specific type.
* This method is a convenience method meant to be used in Java,
* since Kotlin extension methods are painful to use in Java.
*
* @param deserializer The deserializer to use. (e.g. `T.Companion.serializer()`)
*
* @return the deserialized plugin info as type T
*/
fun <T> deserializePluginInfo(deserializer: DeserializationStrategy<T>): T = pluginInfo.deserialize(deserializer)
}

@Serializable
data class Exception(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package dev.arbjerg.lavalink.protocol.v4

import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.serializer
import kotlin.jvm.JvmInline

@Serializable()
inline fun <reified T> JsonObject.deserialize(): T =
deserialize(json.serializersModule.serializer<T>())

fun <T> JsonObject.deserialize(deserializer: DeserializationStrategy<T>): T =
json.decodeFromJsonElement(deserializer, this)

@Serializable
@JvmInline
value class Players(val players: List<Player>)

Expand All @@ -24,7 +32,19 @@ data class Track(
val encoded: String,
val info: TrackInfo,
val pluginInfo: JsonObject
) : LoadResult.Data
) : LoadResult.Data {

/**
* Deserialize the plugin info into a specific type.
* This method is a convenience method meant to be used in Java,
* since Kotlin extension methods are painful to use in Java.
*
* @param deserializer The deserializer to use. (e.g. `T.Companion.serializer()`)
*
* @return the deserialized plugin info as type T
*/
fun <T> deserializePluginInfo(deserializer: DeserializationStrategy<T>): T = pluginInfo.deserialize(deserializer)
}

@Serializable
@JvmInline
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ fun VersionCatalogBuilder.voice() {
library("lavaplayer-ip-rotator", "dev.arbjerg", "lavaplayer-ext-youtube-rotator").versionRef("lavaplayer")
library("lavadsp", "dev.arbjerg", "lavadsp").version("0.7.8")

library("koe", "moe.kyokobot.koe", "core").version("2.0.0-rc1")
library("koe-udpqueue", "moe.kyokobot.koe", "ext-udpqueue").version("2.0.0-rc1")
library("koe", "moe.kyokobot.koe", "core").version("2.0.0-rc2")
library("koe-udpqueue", "moe.kyokobot.koe", "ext-udpqueue").version("2.0.0-rc2")

version("udpqueue", "0.2.7")
val platforms = listOf("linux-x86-64", "linux-x86", "linux-aarch64", "linux-arm", "linux-musl-x86-64", "linux-musl-aarch64", "win-x86-64", "win-x86", "darwin")
Expand Down

0 comments on commit 3adf2d4

Please sign in to comment.