Skip to content

Commit

Permalink
Fix YouTube Chapters (#10)
Browse files Browse the repository at this point in the history
- Update Lavalink Gradle plugin
- Only request id again
- Fix NPE when sponsorblock returns nothing
  • Loading branch information
DRSchlaubi authored Aug 19, 2023
1 parent e7793af commit 7e1979e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id "java"
id "maven-publish"
id "dev.arbjerg.lavalink.gradle-plugin" version "1.0.8"
id "dev.arbjerg.lavalink.gradle-plugin" version "1.0.11"
id "org.jetbrains.kotlin.jvm" version "1.9.0"
id "org.jetbrains.kotlin.plugin.serialization" version "1.9.0"
}
Expand All @@ -19,8 +19,7 @@ println "Version: " + versionStr
archivesBaseName = "sponsorblock-plugin"
lavalinkPlugin {
name = "sponsorblock-plugin"
apiVersion = "4.0.0-beta.1"
serverVersion = gitHash("1c0795bf156fe6559c9c0aed0412bcd8f323a3e0")
apiVersion = "4.0.0-beta.3"
}

sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -40,14 +39,6 @@ dependencies {
implementation(projects.protocol)
implementation("com.github.walkyst.lavaplayer-fork:lava-common:17c75f51f9")
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifactId archivesBaseName
}
}
}

allprojects {
publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public List<Segment> retrieveVideoSegments(String videoId, Set<String> categorie

var json = HttpClientTools.fetchResponseAsJson(this.httpInterfaceManager.getInterface(), request);
if (json == null) {
return null;
return List.of();
}

var segments = new ArrayList<Segment>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fun HttpInterface.requestVideoSearch(query: String): InnerTubeSingleBox<TwoColum
)

fun HttpInterface.requestVideoRendererById(id: String): VideoRenderer? {
val response = requestVideoSearch("https://youtu.be/$id")
val response = requestVideoSearch(id)

return response
.contents
Expand Down

0 comments on commit 7e1979e

Please sign in to comment.