Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lavalink-devs/lavaplayer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.5.1
Choose a base ref
...
head repository: lavalink-devs/lavaplayer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.5.2
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Nov 7, 2023

  1. Provide default value for missing author field (#46)

    For some obscure reason, YouTube do not return an author field for select tracks so we substitute what would be a null value with a placeholder of Unknown artist (consistent with the default value of AudioTrackInfoBuilder#UNKNOWN_ARTIST).
    devoxin authored Nov 7, 2023
    Copy the full SHA
    befc255 View commit details

Commits on Dec 1, 2023

  1. update maven repo to maven.lavalink.dev

    topi314 committed Dec 1, 2023
    Copy the full SHA
    badf536 View commit details

Commits on Dec 3, 2023

  1. update changelog

    topi314 committed Dec 3, 2023
    Copy the full SHA
    77da04d View commit details
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [1.5.2] -- 2023-03-12

* Fix NPE on missing author in playlist tracks in https://github.com/lavalink-devs/lavaplayer/pull/46

## [1.5.1] -- 2023-05-11

* Updated all request timeouts in https://github.com/lavalink-devs/lavaplayer/pull/34
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ number: [![Maven Central](https://img.shields.io/maven-central/v/dev.arbjerg/lav
* Artifact: **dev.arbjerg:lavaplayer:x.y.z**

Snapshots are published
to https://maven.arbjerg.dev/snapshots & https://s01.oss.sonatype.org/content/repositories/snapshots
to https://maven.lavalink.dev/snapshots & https://s01.oss.sonatype.org/content/repositories/snapshots

Using in Gradle:

6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -39,8 +39,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 (release) releases else snapshots) {
credentials {
@@ -50,7 +50,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")
}
}

Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;

@@ -166,9 +165,8 @@ private String extractPlaylistTracks(JsonBrowser playlistVideoList, List<AudioTr
if (!item.get("isPlayable").isNull() && !shortBylineText.isNull()) {
String videoId = item.get("videoId").text();
JsonBrowser titleField = item.get("title");
String title = Optional.ofNullable(titleField.get("simpleText").text())
.orElse(titleField.get("runs").index(0).get("text").text());
String author = shortBylineText.get("runs").index(0).get("text").text();
String title = titleField.get("simpleText").textOrDefault(titleField.get("runs").index(0).get("text").text());
String author = shortBylineText.get("runs").index(0).get("text").textOrDefault("Unknown artist");
JsonBrowser lengthSeconds = item.get("lengthSeconds");
long duration = Units.secondsToMillis(lengthSeconds.asLong(Units.DURATION_SEC_UNKNOWN));

Original file line number Diff line number Diff line change
@@ -148,6 +148,11 @@ public String text() {
return null;
}

public String textOrDefault(String defaultValue) {
String value = text();
return value != null ? value : defaultValue;
}

public boolean asBoolean(boolean defaultValue) {
if (node != null) {
if (node.isBoolean()) {