Malopieds / InnerTune

A fork of InnerTune, a Material 3 YouTube Music client for Android
GNU General Public License v3.0
428 stars 22 forks source link

Weighted Shuffle #340

Open MedwardR opened 3 weeks ago

MedwardR commented 3 weeks ago

Checklist

Feature description

Songs that are played less have a higher chance of being first in the queue.

Why do you want this feature?

With random shuffle, there's not a low chance of getting the same song high in the queue even if you've listened to it several times in the past few days. Likewise, some songs might be rarely played if the random decides not to choose them.

Additional information

Each song would have an integer weight associated with it. When a song finishes playing, its weight is assigned the value of the highest other weight, or +1 if it is the highest. The highest weight could either be calculated at runtime by looping through all weights, or it could simply be stored in the app's data and adjusted whenever a song becomes the new highest, after it finishes playing.

When shuffling, songs with a higher weight are more likely to be later in the queue, and vice versa.

I've had this idea for a while, but never had the time to actually implement it. I figured I would share it here, and if you, or someone else, wants to add it they can.

Here's a flowchart if anyone finds that helpful: diagram diagram.pdf

kaneryu commented 2 weeks ago

+1, but should be an option in settings

MedwardR commented 2 weeks ago

Right, you should be able to toggle this in settings

ThatOneUnoriginal commented 2 weeks ago

I would love something like this. One of the biggest problems with most music platforms is that they seemingly shuffle the same music over and over, causing many other songs in your playlist to be ignored. For example I have a 1000+ long main playlist that I regularly listen to on shuffle and it constantly plays the same songs, especially the first couple songs it plays. And for my example its not like my playlist is lacking a selection of songs.

The only problem I could potentially see is it tracking all that information on large playlists like with my example, 1000 songs in one playlist is quite a bit.