From a2453fe4e4aa02715d5f9b240bc331487f1c921e Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 27 Mar 2023 09:37:41 -0500 Subject: [PATCH 1/9] Remove Mixer source (#853) --- .../main/java/lavalink/server/config/AudioPlayerConfiguration.kt | 1 - .../src/main/java/lavalink/server/config/AudioSourcesConfig.kt | 1 - 2 files changed, 2 deletions(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.kt b/LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.kt index 36aaaae69..6f1b4884a 100644 --- a/LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.kt +++ b/LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.kt @@ -156,7 +156,6 @@ class AudioPlayerConfiguration { if (sources.isBandcamp) audioPlayerManager.registerSourceManager(BandcampAudioSourceManager()) if (sources.isTwitch) audioPlayerManager.registerSourceManager(TwitchStreamAudioSourceManager()) if (sources.isVimeo) audioPlayerManager.registerSourceManager(VimeoAudioSourceManager()) - if (sources.isMixer) audioPlayerManager.registerSourceManager(BeamAudioSourceManager()) if (sources.isLocal) audioPlayerManager.registerSourceManager(LocalAudioSourceManager(mcr)) audioSourceManagers.forEach { diff --git a/LavalinkServer/src/main/java/lavalink/server/config/AudioSourcesConfig.kt b/LavalinkServer/src/main/java/lavalink/server/config/AudioSourcesConfig.kt index 2a0a7dc4b..692d8cfcc 100644 --- a/LavalinkServer/src/main/java/lavalink/server/config/AudioSourcesConfig.kt +++ b/LavalinkServer/src/main/java/lavalink/server/config/AudioSourcesConfig.kt @@ -14,7 +14,6 @@ data class AudioSourcesConfig( var isSoundcloud: Boolean = true, var isTwitch: Boolean = true, var isVimeo: Boolean = true, - var isMixer: Boolean = true, var isHttp: Boolean = true, var isLocal: Boolean = false, ) From 8032e3ca6969bf547ef9c56cb0169469c9b40d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Thu, 20 Apr 2023 22:36:25 +0200 Subject: [PATCH 2/9] Implement full semver spec (#867) * add full semver spec * use build instead og buildmetadata and lost possible version forms * fix buildmetadata * Update IMPLEMENTATION.md Co-authored-by: Freya Arbjerg --------- Co-authored-by: Freya Arbjerg --- IMPLEMENTATION.md | 14 +++++++++----- README.md | 12 ++++++++++-- .../java/dev/arbjerg/lavalink/protocol/v3/info.kt | 10 +++++----- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/IMPLEMENTATION.md b/IMPLEMENTATION.md index b107b7eff..d42ef4d92 100644 --- a/IMPLEMENTATION.md +++ b/IMPLEMENTATION.md @@ -1294,6 +1294,8 @@ Response: ##### Version Object +Parsed Semantic Versioning 2.0.0. See https://semver.org/ for more info + | Field | Type | Description | |------------|---------|------------------------------------------------------------------------------------| | semver | string | The full version string of this Lavalink server | @@ -1301,6 +1303,7 @@ Response: | minor | int | The minor version of this Lavalink server | | patch | int | The patch version of this Lavalink server | | preRelease | ?string | The pre-release version according to semver as a `.` separated list of identifiers | +| build | ?string | The build metadata according to semver as a `.` separated list of identifiers | ##### Git Object @@ -1323,11 +1326,12 @@ Response: ```json { "version": { - "string": "3.7.0-rc.1", + "string": "3.7.0-rc.1+test", "major": 3, "minor": 7, "patch": 0, - "preRelease": "rc.1" + "preRelease": "rc.1", + "build": "test" }, "buildTime": 1664223916812, "git": { @@ -1343,9 +1347,9 @@ Response: ], "filters": [ "equalizer", - "karaoke", - "timescale", - "channelMix" + "karaoke", + "timescale", + "channelMix" ], "plugins": [ { diff --git a/README.md b/README.md index b6bf5a6dd..7e4af374d 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,22 @@ Please see [here](CHANGELOG.md) Lavalink follows [Semantic Versioning](https://semver.org/). -Given a version number `MAJOR.MINOR.PATCH`, the following rules apply: +The version number is composed of the following parts: MAJOR breaking API changes MINOR new backwards compatible features PATCH backwards compatible bug fixes + PRERELEASE pre-release version + BUILD additional build metadata -Additional labels for release candidates are available as extensions to the `MAJOR.MINOR.PATCH-rcNUMBER`(`3.6.0-rc1`) format. +Version numbers can come in different combinations, depending on the release type: + `MAJOR.MINOR.PATCH` - Stable release + `MAJOR.MINOR.PATCH+BUILD` - Stable release with additional build metadata + `MAJOR.MINOR.PATCH-PRERELEASE` - Pre-release + `MAJOR.MINOR.PATCH-PRERELEASE+BUILD` - Pre-release additional build metadata + +--- ## Client libraries: | Client | Platform | Compatible With | REST API Support | Additional Information | diff --git a/protocol/src/main/java/dev/arbjerg/lavalink/protocol/v3/info.kt b/protocol/src/main/java/dev/arbjerg/lavalink/protocol/v3/info.kt index b1202fb40..97333e97b 100644 --- a/protocol/src/main/java/dev/arbjerg/lavalink/protocol/v3/info.kt +++ b/protocol/src/main/java/dev/arbjerg/lavalink/protocol/v3/info.kt @@ -19,19 +19,19 @@ data class Version( val minor: Int, val patch: Int, val preRelease: String?, + val build: String?, ) { companion object { - private val versionRegex = - Regex("""^(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?""") - + private val versionRegex = Regex("""^(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$""") fun fromSemver(semver: String): Version { - val match = versionRegex.matchEntire(semver) ?: return Version(semver, 0, 0, 0, null) + val match = versionRegex.matchEntire(semver) ?: return Version(semver, 0, 0, 0, null, null) val major = match.groups["major"]!!.value.toInt() val minor = match.groups["minor"]!!.value.toInt() val patch = match.groups["patch"]!!.value.toInt() val preRelease = match.groups["prerelease"]?.value - return Version(semver, major, minor, patch, preRelease) + val build = match.groups["build"]?.value + return Version(semver, major, minor, patch, preRelease, build) } } } From b656672381a0b791584c26631f9df02d7453ddf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Sat, 29 Apr 2023 01:39:59 +0200 Subject: [PATCH 3/9] update lavaplayer (#872) --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index ae9daa475..8a2f2801c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -38,7 +38,7 @@ fun VersionCatalogBuilder.spring() { } fun VersionCatalogBuilder.voice() { - version("lavaplayer", "1.4.0") + version("lavaplayer", "1.4.1") library("lavaplayer", "com.github.walkyst.lavaplayer-fork", "lavaplayer").versionRef("lavaplayer") library("lavaplayer-ip-rotator", "com.github.walkyst.lavaplayer-fork", "lavaplayer-ext-youtube-rotator").versionRef("lavaplayer") From 313cf0ac346e1392920855b8948bd123ce56a078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Thu, 18 May 2023 22:19:40 +0200 Subject: [PATCH 4/9] use getDuration instead of info.length (#877) --- LavalinkServer/src/main/java/lavalink/server/util/util.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/util/util.kt b/LavalinkServer/src/main/java/lavalink/server/util/util.kt index 67dd89c32..ced869329 100644 --- a/LavalinkServer/src/main/java/lavalink/server/util/util.kt +++ b/LavalinkServer/src/main/java/lavalink/server/util/util.kt @@ -44,7 +44,7 @@ fun AudioTrack.toInfo(): TrackInfo { this.identifier, this.isSeekable, this.info.author, - this.info.length, + this.duration, this.info.isStream, this.position, this.info.title, From 975a26c7eb1c0738caa487db0ed4f8dba4a34a48 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 9 Jun 2023 10:58:48 +0200 Subject: [PATCH 5/9] bump oshio to 6.4.3 --- LavalinkServer/build.gradle.kts | 5 ++++- settings.gradle.kts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index 7aa5770b5..5aa9d591e 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -58,7 +58,10 @@ dependencies { implementation(libs.kotlin.reflect) implementation(libs.logback) implementation(libs.sentry.logback) - implementation(libs.oshi) + implementation(libs.oshi) { + // This version of SLF4J does not recognise Logback 1.2.3 + exclude(group = "org.slf4j", module = "slf4j-api") + } implementation(libs.json) compileOnly(libs.spotbugs) diff --git a/settings.gradle.kts b/settings.gradle.kts index 8a2f2801c..2cc6f7107 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -75,7 +75,7 @@ fun VersionCatalogBuilder.common() { library("logback", "ch.qos.logback", "logback-classic").version("1.2.3") library("sentry-logback", "io.sentry", "sentry-logback").version("1.7.2") - library("oshi", "com.github.oshi", "oshi-core").version("5.7.4") + library("oshi", "com.github.oshi", "oshi-core").version("6.4.3") library("json", "org.json", "json").version("20180813") library("spotbugs", "com.github.spotbugs", "spotbugs-annotations").version("3.1.6") From 97cdc4cb501ae03720a37d840d5fb3f6c60175bd Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 9 Jun 2023 14:06:37 +0200 Subject: [PATCH 6/9] use oshi 5.8.3 --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 2cc6f7107..77dfad051 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -75,7 +75,7 @@ fun VersionCatalogBuilder.common() { library("logback", "ch.qos.logback", "logback-classic").version("1.2.3") library("sentry-logback", "io.sentry", "sentry-logback").version("1.7.2") - library("oshi", "com.github.oshi", "oshi-core").version("6.4.3") + library("oshi", "com.github.oshi", "oshi-core").version("5.8.3") library("json", "org.json", "json").version("20180813") library("spotbugs", "com.github.spotbugs", "spotbugs-annotations").version("3.1.6") From d9ac377904964a71b9b150f9d2dee7626a3b60d8 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 9 Jun 2023 14:31:53 +0200 Subject: [PATCH 7/9] check process for null --- .../src/main/java/lavalink/server/io/StatsCollector.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LavalinkServer/src/main/java/lavalink/server/io/StatsCollector.kt b/LavalinkServer/src/main/java/lavalink/server/io/StatsCollector.kt index d70f1fc56..0c951cd65 100644 --- a/LavalinkServer/src/main/java/lavalink/server/io/StatsCollector.kt +++ b/LavalinkServer/src/main/java/lavalink/server/io/StatsCollector.kt @@ -50,6 +50,11 @@ class StatsCollector(val socketServer: SocketServer) { get() { val p = os.getProcess(os.processId) + if (p == null) { + log.warn("Could not get process stats, process null") + return 0.0 + } + val output: Double = if (cpuTime != 0.0) { val uptimeDiff = p.upTime - uptime val cpuDiff = p.kernelTime + p.userTime - cpuTime From 40a51fbb00d3c3af8e416e14223733e946b10cf3 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Fri, 9 Jun 2023 14:44:47 +0200 Subject: [PATCH 8/9] let's try oshi 6.4.3 again --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 77dfad051..2cc6f7107 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -75,7 +75,7 @@ fun VersionCatalogBuilder.common() { library("logback", "ch.qos.logback", "logback-classic").version("1.2.3") library("sentry-logback", "io.sentry", "sentry-logback").version("1.7.2") - library("oshi", "com.github.oshi", "oshi-core").version("5.8.3") + library("oshi", "com.github.oshi", "oshi-core").version("6.4.3") library("json", "org.json", "json").version("20180813") library("spotbugs", "com.github.spotbugs", "spotbugs-annotations").version("3.1.6") From 8b99625901f7bed27a890f3e0bf31c95c4e12325 Mon Sep 17 00:00:00 2001 From: topi314 Date: Sun, 10 Dec 2023 14:00:00 +0100 Subject: [PATCH 9/9] update oshi to 6.4.8 --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 70763745b..696651de8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -75,7 +75,7 @@ fun VersionCatalogBuilder.common() { library("logback", "ch.qos.logback", "logback-classic").version("1.2.3") library("sentry-logback", "io.sentry", "sentry-logback").version("1.7.2") - library("oshi", "com.github.oshi", "oshi-core").version("6.4.3") + library("oshi", "com.github.oshi", "oshi-core").version("6.4.8") library("json", "org.json", "json").version("20180813") library("spotbugs", "com.github.spotbugs", "spotbugs-annotations").version("3.1.6")