Skip to content

Commit

Permalink
Fix position and use isSeekable (lavalink-devs#48)
Browse files Browse the repository at this point in the history
Repulser authored and freyacodes committed Dec 21, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8fa6dd5 commit 0d69043
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -130,7 +130,6 @@ public boolean isPaused() {
@Override
public long getTrackPosition() {
if (getPlayingTrack() == null) throw new IllegalStateException("Not currently playing anything");
if (getPlayingTrack().getInfo().isStream) return Long.MAX_VALUE;

if (!paused) {
// Account for the time since our last update
@@ -145,7 +144,7 @@ public long getTrackPosition() {
@Override
public void seekTo(long position) {
if (getPlayingTrack() == null) throw new IllegalStateException("Not currently playing anything");
if (getPlayingTrack().getInfo().isStream) throw new IllegalStateException("Can't seek in a stream");
if (!getPlayingTrack().isSeekable()) throw new IllegalStateException("Track cannot be seeked");

JSONObject json = new JSONObject();
json.put("op", "seek");

0 comments on commit 0d69043

Please sign in to comment.