[V3 Audio] Local playback #2097

Merged
aikaterna merged 5 commits from patch-7 into V3/develop 2018-09-09 15:02:54 +02:00
aikaterna commented 2018-09-04 06:04:09 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

This builds on top of #2077 and could be used in favor of it.

Filetype support: .mp3, .flac, .ogg

Local tracks can be queued a few ways:

  • [p]play localtracks/foldername/song_to_play.mp3
  • [p]local play (interactive)
  • [p]local folder (interactive, queues an entire localtracks folder)
  • [p]local search (interactive, queues the user-picked track via menu)

Informational display will favor ID3 tag information, but if it's not available, it'll use the file name.

If you're looking to test this as an existing user:

  • You must be using an internal lavalink server, or your jar should live in the audio data folder if it's external.

  • Tracks should go in a localtracks folder under the audio data directory. Place tracks inside an additional subfolder. You can have as many subfolders under localtracks as you want, however audio only looks one folder deep for tracks.

For example:

data_directory/cogs/Audio/localtracks/Album Folder Name/Artist - Track.mp3

data_directory/cogs/Audio/localtracks/Another Great Album/Another Artist - Another Track.mp3

are both valid paths for tracks.

General error reporting in Discord is disabled for local tracks. Lavalink is not best-suited for local track playback and can complain at the end of every mp3 file but play the entire thing, for example.

Something to be considered before merging: There should be a way to determine if someone has an existing lavalink.jar and application.yml and be able to overwrite them both, or set them to download & overwrite by default on the release this is included in.

### Type - [ ] Bugfix - [ ] Enhancement - [x] New feature ### Description of the changes This builds on top of #2077 and could be used in favor of it. Filetype support: .mp3, .flac, .ogg Local tracks can be queued a few ways: - `[p]play localtracks/foldername/song_to_play.mp3` - `[p]local play` (interactive) - `[p]local folder` (interactive, queues an entire localtracks folder) - `[p]local search` (interactive, queues the user-picked track via menu) Informational display will favor ID3 tag information, but if it's not available, it'll use the file name. If you're looking to test this as an existing user: - You must be using an internal lavalink server, or your jar should live in the audio data folder if it's external. - Tracks should go in a localtracks folder under the audio data directory. Place tracks inside an additional subfolder. You can have as many subfolders under localtracks as you want, however audio only looks one folder deep for tracks. For example: data_directory/cogs/Audio/localtracks/Album Folder Name/Artist - Track.mp3 data_directory/cogs/Audio/localtracks/Another Great Album/Another Artist - Another Track.mp3 are both valid paths for tracks. - Replace the lavalink.jar in your audio data directory with build no. 584 (https://ci.fredboat.com/repository/download/Lavalink_Build/4825:id/Lavalink.jar?guest=1) - Change `local: false` in the application.yml file in audio's data path to `true`. - If your files return "Nothing found.", check your error.log or the lavalink.log in the data directory to see if it was an encoding error. General error reporting in Discord is disabled for local tracks. Lavalink is not best-suited for local track playback and can complain at the end of every mp3 file but play the entire thing, for example. Something to be considered before merging: There should be a way to determine if someone has an existing lavalink.jar and application.yml and be able to overwrite them both, or set them to download & overwrite by default on the release this is included in.
calebj (Migrated from github.com) reviewed 2018-09-04 06:04:09 +02:00
Twentysix26 (Migrated from github.com) reviewed 2018-09-04 06:04:09 +02:00
Tobotimus (Migrated from github.com) reviewed 2018-09-06 17:20:59 +02:00
@ -1114,0 +1355,4 @@
if "localtracks/" in player.current.uri:
description = "**{}**\n{}".format(
player.current.title, player.current.uri.replace("localtracks/", "")
)
Tobotimus (Migrated from github.com) commented 2018-09-06 17:20:59 +02:00

Literally my only qualm with this PR right now, could you add a linebreak in this help message? :D

Literally my only qualm with this PR right now, could you add a linebreak in this help message? :D
mikeshardmind (Migrated from github.com) requested changes 2018-09-07 21:47:23 +02:00
mikeshardmind (Migrated from github.com) left a comment

Seems to work fine for the features added. Ran into a small issue at first testing since this was missing bugfixes added since work started, but just merged those locally and was fine.

I did notice something that appears to be by design(especially with comments in the PR description), but I think changing it is preferable.

While I understand not traversing directories infinitely in an interactive menu, It would be nice to be able to specify a specific path contained in local tracks to play from, or a specific file and have it work correctly in any amount of nesting. I have audio files in my music directory as

Music Folder/Artist Name/Album Name/track number - Trackname.extension

I can't just symlink this folder to where localtracks is expected due to this limitation on directory traversal.

Seems to work fine for the features added. Ran into a small issue at first testing since this was missing bugfixes added since work started, but just merged those locally and was fine. I did notice something that appears to be by design(especially with comments in the PR description), but I think changing it is preferable. While I understand not traversing directories infinitely in an interactive menu, It would be nice to be able to specify a specific path contained in local tracks to play from, or a specific file and have it work correctly in any amount of nesting. I have audio files in my music directory as ``` Music Folder/Artist Name/Album Name/track number - Trackname.extension ``` I can't just symlink this folder to where localtracks is expected due to this limitation on directory traversal.
aikaterna commented 2018-09-07 22:15:29 +02:00 (Migrated from github.com)

That's planned/intended (being able to have a different directory than the internal lavalink dir). Just not in this PR yet.

Also, I won't be able to support infinite folders. It'll need to be one directory deep from the localtracks dir.

That's planned/intended (being able to have a different directory than the internal lavalink dir). Just not in this PR yet. Also, I won't be able to support infinite folders. It'll need to be one directory deep from the localtracks dir.
mikeshardmind (Migrated from github.com) reviewed 2018-09-07 22:40:55 +02:00
mikeshardmind (Migrated from github.com) left a comment
No description provided.
Modifying prior review to approving since the changes requested are planned improvement in future PR instead, and the changes requested do not necessarily need to happen for the rest of this PR to be valid.
mikeshardmind commented 2018-09-07 22:42:35 +02:00 (Migrated from github.com)

I'm not saying it should support infinite folder depth, but I do think it should support more than just 1 if passed the path directly, and not using the interactive menu.

I'm not saying it should support infinite folder depth, but I do think it should support more than just 1 if passed the path directly, and not using the interactive menu.
Tobotimus (Migrated from github.com) approved these changes 2018-09-09 15:02:41 +02:00
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!2097
No description provided.