th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
8.19k stars 484 forks source link

Add a better shuffle algorithm (suggestion) #601

Open YvesW opened 2 years ago

YvesW commented 2 years ago

I personally feel like shuffling my liked songs very often results in songs being played by the same artist in a row. Not entirely sure if youtube's algorithm is just shit, of that it actually uses e.g. Fisher-Yates shuffling but that it's just gambler's fallacy. However, implementing an algorithm based on e.g. http://keyj.emphy.de/balanced-shuffle/ or Floyd–Steinberg dithering would be very cool.

Araxeus commented 2 years ago

From what I know the problem is that it only "shuffle" the current queue (which is max 50 songs)

no clue how to fix it without rewriting the whole music playing logic

YvesW commented 2 years ago

Hm, even if you use the shuffle button at the top? Thought it only did that if you clicked the shuffle in the player button.

afbeelding

Araxeus commented 2 years ago

You're right, the shuffle icon at the top does shuffle the whole playlist from what I know

YvesW commented 2 years ago

You're right, the shuffle icon at the top does shuffle the whole playlist from what I know

Yeah, would be cool if an option could be added for changing to a "better" shuffling algorithm when using that shuffle button, but I've got no experience with shuffle algorithms or YT music myself, so no idea how difficult that'd be to implement. As an example, in my current queue I got 12 pentakill songs followed by 30 foo fighters songs, which is probably (close to) all the Foo Fighters songs I have on my liked list, so the currently used algorithm might also be broken.