[V3 Audio] Add thumbnail display with toggle #1998

Merged
aikaterna merged 10 commits from patch-2 into V3/develop 2018-08-25 02:47:21 +02:00
aikaterna commented 2018-08-10 22:22:39 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Adds a toggle to display a thumbnail for YouTube tracks on notify messages, [p]now and [p]queue for the current song. Thanks to Bramble for the suggestion/request.

### Type - [ ] Bugfix - [x] Enhancement - [ ] New feature ### Description of the changes Adds a toggle to display a thumbnail for YouTube tracks on notify messages, [p]now and [p]queue for the current song. Thanks to Bramble for the suggestion/request.
calebj (Migrated from github.com) reviewed 2018-08-11 22:32:00 +02:00
calebj (Migrated from github.com) commented 2018-08-11 22:32:00 +02:00

Will this always be the second item in values()? Would it have a key instead? Also, is it possible to patch Red-Lavalink for this?

Will this always be the second item in `values()`? Would it have a key instead? Also, is it possible to patch Red-Lavalink for this?
aikaterna (Migrated from github.com) reviewed 2018-08-12 00:29:43 +02:00
aikaterna (Migrated from github.com) commented 2018-08-12 00:29:42 +02:00

Changed it up a bit. And the thumbnail fetching maybe should be moved to Red-Lavalink.

Changed it up a bit. And the thumbnail fetching maybe should be moved to Red-Lavalink.
Crossedfall commented 2018-08-12 22:10:39 +02:00 (Migrated from github.com)

Tested in Windows (10/Server 2016) and Linux (Debian/Ubuntu/Centos 7) in python 3.6.5 and 3.6.6 with no issues. Also tested this using the "built-in" version of lavalink and using an externally hosted node, no differences there even when the external node had experimental changes applied.

Testing Procedure:

  1. Begin playing a single song
  2. Run the [p]now and [p]queue commands
  3. Verify that there are no thumbnails
  4. Enable thumbnails with [p]audioset thumbnail
  5. Run the [p]now and [p]queue commands again
  6. Verify that there are thumbnails
  7. Add a large playlist to the queue (100+ songs) and begin skipping through the songs
  8. Re-verify that thumbnails are displayed between every third skip for the [p]now and [p]queue commands respectively 5 times
  9. Disable thumbnails and repeat step 8, instead verifying that thumbnails are not being displayed
Tested in Windows (10/Server 2016) and Linux (Debian/Ubuntu/Centos 7) in python 3.6.5 and 3.6.6 with no issues. Also tested this using the "built-in" version of lavalink and using an externally hosted node, no differences there even when the external node had experimental changes applied. **Testing Procedure**: 1. Begin playing a single song 2. Run the `[p]now` and `[p]queue` commands 3. Verify that there are no thumbnails 4. Enable thumbnails with `[p]audioset thumbnail` 5. Run the `[p]now` and `[p]queue` commands again 6. Verify that there are thumbnails 7. Add a large playlist to the queue (100+ songs) and begin skipping through the songs 8. Re-verify that thumbnails are displayed between every third skip for the `[p]now` and `[p]queue` commands respectively 5 times 9. Disable thumbnails and repeat step 8, instead verifying that thumbnails are not being displayed
calebj (Migrated from github.com) requested changes 2018-08-12 22:11:08 +02:00
calebj (Migrated from github.com) commented 2018-08-12 22:10:59 +02:00

Why not

if "youtube" in track.uri and "identifier" in track._info:
    return "https://img.youtube.com/vi/{}/mqdefault.jpg".format(track._info["identifier"])

or even

    return "https://img.youtube.com/vi/{identifier}/mqdefault.jpg".format(**track._info)

The return None is redundant behavior.

These are acceptable... but I still prefer changing the library instead.

Why not ```py if "youtube" in track.uri and "identifier" in track._info: return "https://img.youtube.com/vi/{}/mqdefault.jpg".format(track._info["identifier"]) ``` or even ```py return "https://img.youtube.com/vi/{identifier}/mqdefault.jpg".format(**track._info) ``` The `return None` is redundant behavior. These are acceptable... but I still prefer changing the library instead.
aikaterna (Migrated from github.com) reviewed 2018-08-20 02:44:38 +02:00
aikaterna (Migrated from github.com) commented 2018-08-20 02:44:38 +02:00

After https://github.com/Cog-Creators/Red-Lavalink/pull/38 is merged and released, I'll make another PR to change audio to use it.

After https://github.com/Cog-Creators/Red-Lavalink/pull/38 is merged and released, I'll make another PR to change audio to use it.
calebj (Migrated from github.com) reviewed 2018-08-20 03:54:26 +02:00
calebj (Migrated from github.com) left a comment
No description provided.
Looking good. I also recommend adding a TODO comment referencing Cog-Creators/Red-Lavalink#38.
Tobotimus (Migrated from github.com) approved these changes 2018-08-25 02:47:10 +02:00
Tobotimus (Migrated from github.com) left a comment

Thanks @aikaterna!

Thanks @aikaterna!
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!1998
No description provided.