[3.2][Audio] Part 5 (Last) #3213
No reviewers
Labels
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!3213
Loading…
Reference in a new issue
No description provided.
Delete branch "part-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
This is the last PR for the CPR, it depends on #3209, #3210, #3211 and #3212 and should be merged last
Description of the changes
Okay so this should in theory significantly improve audio performance across the border for folks that use the playlist function
@PredaaA using Mart on dev which has #2921 (which significantly reduces JSON size went from 50+MB prior to #2921 to 18.6MB prior to this PR)
With this PR his audio config went from 18.6MB to 287.12 KB... (and say we want to also migrate the EQUALIZER scope to an SQL table ... his config was reduced to 42.97 KB) which should significantly reduce write times and overall make audio commands feel speedier.
(Some more data With this PR @ Cat's config went from over 37MB to only 33kb, speeding up all commands that touches config)
@ -185,3 +82,4 @@) -> MutableMapping[str, str]:if params is None:params = {}async with self.session.request("GET", url, params=params, headers=headers) as r:MutableMappingshould be used here instead of Mapping for the type (Same anywhere else you return a mapping which gets modified later so that dev toolings don't complain when opening the file)(Note for later, not necessary to change in this PR, just noticed while reading through the full context)
The logic from here down including all branches attached to this if statement gets convoluted. There are 2 branches with identical implementations, separated by another branch. It's not valid to merge the branches directly either, and it won't be immediately obvious as to why. This should probably be looked at for a clarity improvement later on.
I've not reviewed this or it's components in entirety or tested the full set of changes here.
I saw a few things which can have minor changes to be slightly better with tooling (mostly type hints)
I saw some logic and SQL that looks like it should work but should likely be handled as part of #3226 (The SQL even has a nice comment to some prior discussion regarding this in the code, +1)
I didn't see anything problematic code wise beyond this, but I have not tested the changes for being correct on the behavioral side. As I have been less involved with Audio's overall design and direction,
I'd prefer to leave judging if the behavioral parts are fine to other people more capable of determining that, especially since some of these changes are going to be more noticeable for people running larger public Red instances (such as cat, bb8, martine)
Using [p]search list searchterm with dj role on allows people to queue tracks when they shouldn't be allowed to.
Vote mode only, with DJ mode off:
The audioset vote setting should protect the prev command as well. People can use previous without being told no if vote is on.
Summon should also be protected in this mode, which it isn't at the moment.
Jukebox on, user had no currency
Since Draper asked me, I'm mentioning this here.
[p]playlist downloadcurrently passesStringIOobject todiscord.Fileeven though it only supports objects with binary data (i.e.BytesIO). While this haven't caused any troubles yet, this isn't the safeest thing to do.I would advice using
BytesIOobjects instead and also explicitly using utf-8 encoding for saving and loading them to avoid any weird encoding issues.Using
StringIOmade it save playlist files with ascii encoding, which utf-8 so happens to be compatible with.I will be moving further testing and commenting to #3244 via Draper's direction on this.
Closing as #3244 will be the merge for the cascading PR, and Draper asked me to.
Pull request closed