Skip to content

Commit

Permalink
maybe fix null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Oct 29, 2022
1 parent 12bec7a commit c9578f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var moduleName = "lavasrc"

dependencies {
compileOnly "com.github.walkyst:lavaplayer-fork:1.3.98.4"
implementation 'org.jsoup:jsoup:1.14.3'
implementation "org.jsoup:jsoup:1.14.3"
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.topisenpai.lavasrc.yandexmusic;

import com.sedmelluq.discord.lavaplayer.container.mp3.Mp3AudioTrack;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager;
import com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
Expand Down Expand Up @@ -44,6 +45,11 @@ protected AudioTrack makeShallowClone() {
return new YandexMusicAudioTrack(this.trackInfo, this.artworkURL, this.sourceManager);
}

@Override
public AudioSourceManager getSourceManager() {
return this.sourceManager;
}

private String getDownloadURL(String id) throws IOException, NoSuchAlgorithmException {
var json = this.sourceManager.getJson(YandexMusicSourceManager.PUBLIC_API_BASE + "/tracks/" + id + "/download-info");
if (json.isNull() || json.get("result").values().isEmpty()) {
Expand Down

0 comments on commit c9578f4

Please sign in to comment.