-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix not npe when searching yt tracks via lavasearch
- Loading branch information
Showing
3 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
main/src/main/java/com/github/topi314/lavasrc/youtube/YouTubeAudioSearchTrack.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
package com.github.topi314.lavasrc.youtube | ||
|
||
import com.github.topi314.lavasrc.ExtendedAudioTrack | ||
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager | ||
import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager | ||
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo | ||
import com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor | ||
|
||
class YouTubeAudioSearchTrack(trackInfo: AudioTrackInfo, albumName: String?) : | ||
class YouTubeAudioSearchTrack( | ||
private val sourceManager: YoutubeAudioSourceManager, | ||
trackInfo: AudioTrackInfo, | ||
albumName: String? | ||
) : | ||
ExtendedAudioTrack(trackInfo, albumName, null, null, null, null, false) { | ||
override fun process(executor: LocalAudioTrackExecutor?) = Unit | ||
|
||
override fun makeClone() = YouTubeAudioSearchTrack(sourceManager, trackInfo, albumName) | ||
|
||
override fun getSourceManager(): AudioSourceManager { | ||
return sourceManager | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters