Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seek command (supersedes #344) #674

Merged
merged 42 commits into from
May 10, 2024

Conversation

MichailiK
Copy link
Collaborator

@MichailiK MichailiK commented Apr 12, 2021

This pull request...

  • Fixes a bug
  • Introduces a new feature
  • Improves an existing feature
  • Boosts code quality or performance

Description

Allows DJs and user that added the track to perform a seek on a playing track

Purpose

Example: Going to a specific timestamp in a song compilation.

Relevant Issue(s)

This PR supersedes PR #344, as the author whew-inc stated that they will no longer be working on their pull request, I have decided to pick up on it

Currently, I am working on the change requests in #344.

  • starting a song at a specific time (both via the play command as well as in playlists; youtube has a format for this and jmusicbot should probably adapt that same format)

And, because YouTube's time parameter can either be just seconds or 1h2m3s

whew-inc and others added 30 commits January 22, 2020 04:27
# Conflicts:
#	src/main/java/com/jagrosh/jmusicbot/audio/QueuedTrack.java
#	src/main/java/com/jagrosh/jmusicbot/commands/music/QueueCmd.java
@MichailiK
Copy link
Collaborator Author

MichailiK commented Sep 8, 2021

As of writing, the jcenter.bintray.com repository is unavailable, which houses lavaplayer-natives-extra and JLyrics. App Veyor's logs match with mine:

Maven output
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.jagrosh:JMusicBot >------------------------
[INFO] Building JMusicBot Snapshot
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom (8.1 kB at 17 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/23/maven-plugins-23.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/23/maven-plugins-23.pom (9.2 kB at 135 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/22/maven-parent-22.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/22/maven-parent-22.pom (30 kB at 313 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/11/apache-11.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/11/apache-11.pom (15 kB at 221 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar (30 kB at 304 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom (10 kB at 134 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom (11 kB at 69 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom (33 kB at 582 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar (43 kB at 537 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom (10 kB at 109 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom (14 kB at 212 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar (30 kB at 350 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 77 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 163 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/21/maven-parent-21.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/21/maven-parent-21.pom (26 kB at 342 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/10/apache-10.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/10/apache-10.pom (15 kB at 200 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar (34 kB at 382 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.5/maven-shade-plugin-1.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.5/maven-shade-plugin-1.5.pom (5.9 kB at 98 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.5/maven-shade-plugin-1.5.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.5/maven-shade-plugin-1.5.jar (83 kB at 648 kB/s)
Downloading from bintray-sedmelluq-com.sedmelluq: https://dl.bintray.com/sedmelluq/com.sedmelluq/com/sedmelluq/lavaplayer-natives-extra/1.3.13/lavaplayer-natives-extra-1.3.13.pom
Downloading from bintray-sedmelluq-com.sedmelluq: https://dl.bintray.com/sedmelluq/com.sedmelluq/com/jagrosh/JLyrics/0.5/JLyrics-0.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.259 s
[INFO] Finished at: 2021-09-08T20:04:18+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project JMusicBot: Could not resolve dependencies for project com.jagrosh:JMusicBot:jar:Snapshot: Failed to collect dependencies at com.sedmelluq:lavaplayer-natives-extra:jar:1.3.13: Failed to read artifact descriptor for com.sedmelluq:lavaplayer-natives-extra:jar:1.3.13: Could not transfer artifact com.sedmelluq:lavaplayer-natives-extra:pom:1.3.13 from/to bintray-sedmelluq-com.sedmelluq (https://dl.bintray.com/sedmelluq/com.sedmelluq): Authorization failed for https://dl.bintray.com/sedmelluq/com.sedmelluq/com/sedmelluq/lavaplayer-natives-extra/1.3.13/lavaplayer-natives-extra-1.3.13.pom 403 Forbidden -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

The dependency issues have been resolved now.

…feature/seeking

� Conflicts:
�	src/main/java/com/jagrosh/jmusicbot/audio/AudioHandler.java
�	src/main/java/com/jagrosh/jmusicbot/audio/QueuedTrack.java
�	src/main/java/com/jagrosh/jmusicbot/commands/music/QueueCmd.java
@Minenash
Copy link

What still needs to be done before this can be merged?

@antaxiom
Copy link

I'd also like to know what else we need for this to be working

…feature/seeking

� Conflicts:
�	src/main/java/com/jagrosh/jmusicbot/audio/AudioHandler.java
�	src/main/java/com/jagrosh/jmusicbot/audio/QueuedTrack.java
@MichailiK MichailiK marked this pull request as ready for review April 20, 2022 18:57
@MichailiK MichailiK requested a review from jagrosh April 20, 2022 19:21
@n-tdi
Copy link

n-tdi commented Jul 1, 2023

Still waiting for this to be merged.

@rojosinalma
Copy link

@jagrosh will this be merged?

…feature/seeking

# Conflicts:
#	src/main/java/com/jagrosh/jmusicbot/audio/AudioHandler.java
#	src/main/java/com/jagrosh/jmusicbot/audio/QueuedTrack.java
#	src/main/java/com/jagrosh/jmusicbot/commands/music/QueueCmd.java
#	src/main/java/com/jagrosh/jmusicbot/utils/FormatUtil.java
@jagrosh jagrosh added this to the 0.4.1 milestone Mar 14, 2024
@jagrosh jagrosh merged commit 81322ef into jagrosh:master May 10, 2024
1 of 2 checks passed
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add the Ability to Skip to a Certain Time in a Song
8 participants