Comments (6)
It seems as though albums with more songs tend to rise to the top. From 12 "PlayAll" presses from the song list, I saw only 3 different albums first and they tended to be close to the top consistently. I have 100+ albums and the 3 are the ones I have the most songs for.
from vanilla.
Glancing at the code, it would take some more time to go through and see if there are any logic errors. It might me fairer (though slower) to get a list of albums, shuffle it and then expand each album into a list of songs.
from vanilla.
I've been bothered by this too and I've finally got round to writing a solution which is now in my fork. I'll put in a pull request for it to be pulled into a future version.
The old album shuffle was an attempt at a Fisher-Yates shuffle and made the mistake that it picked each album to shuffle by picking a random song in the sorted song list and then finding the start of that album, which means that it was more likely to pick bigger albums first.
Fisher-Yates doesn't really work in this case as the albums are not all the same length, so I just pulled out a list of albums and used Collections.shuffle(). This is basically what you've said mathstuf and it isn't slower, it's faster as the old method did a lot of excess arrayCopys. I've tested it both in code and by repeatedly calling play all and looking at the queue and it seems to me to fix this bug.
from vanilla.
On Mon, Feb 17, 2014 at 15:48:58 -0800, piemonkey wrote:
I've been bothered by this too and I've finally got round to writing a
solution which is now in my fork. I'll put in a pull request for it to
be pulled into a future version.
Woo! Thanks!
The old album shuffle was an attempt at a Fisher-Yates shuffle and
made the mistake that it picked each album to shuffle by picking a
random song in the sorted song list and then finding the start of that
album, which means that it was more likely to pick bigger albums
first.
Hmm. I thought it picked randomly until it found a first-song-in-album.
Maybe I'm remembering incorrectly (it has been a year...).
Fisher-Yates doesn't really work in this case as the albums are not
all the same length, so I just pulled out a list of albums and used
Collections.shuffle(). This is basically what you've said mathstuf and
it isn't slower, it's faster as the old method did a lot of excess
arrayCopys. I've tested it both in code and by repeatedly calling play
all and looking at the queue and it seems to me to fix this bug.
Yeah, that's what I thought when I looked at it, but my Java-fu is weak
and I got frustrated fighting against Eclipse.
from vanilla.
"I thought it picked randomly until it found a first-song-in-album."
In the first while loop within the album shuffle for loop it takes the random j value, checks if the corresponding song is the start of an album and if not does j -= 1. What it should maybe have done is pick another random j but that would have slowed it down even further.
from vanilla.
Closing this old bug as the patch from issue 71 was already merged
from vanilla.
Related Issues (20)
- Original album artist not being shown correctly
- Remote control response doesn't always work HOT 2
- Track No. ≥10 ordered incorrectly HOT 2
- Problems with headphone detector plugin HOT 3
- Pixel Buds Pro next track pauses
- Notification disappears if you tap Pause (Android 13) HOT 2
- Next song plays on double tapping Play/Pause from notification (Android 13)
- SQLite had an error 'inserting UNIQUE constraint failed: covercache.id'
- Vanilla opens when I disconnect bluetooth headphones after using my audiobook player.
- Audio doesn't use USB audio unless dongle disconnected, reconnected HOT 3
- new circle icons are cut in the notifications panel (play, previous song, next song) HOT 1
- Vanilla + Hiby R6 gen 3 + a particular Flac file always stops at 39/40 seconde HOT 6
- Adding an option to always show the playlist when the device is in portrait mode
- A mp3 file on a Hiby R6 gen 3 makes Vanilla player unable to play the following files HOT 6
- Unable to Dump database HOT 1
- Identically named album titles by different album artists are grouped as one
- Please support file browsing via bluetooth
- (Soft?) Crash after ending a received phone call
- After using Vanilla, adsprpcd keeps device awake constantly [A13]
- Gapless function not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vanilla.