Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Albums in My Library have tracks in the wrong order #37

Closed
sbernardjr opened this issue Apr 6, 2014 · 9 comments
Closed

Albums in My Library have tracks in the wrong order #37

sbernardjr opened this issue Apr 6, 2014 · 9 comments

Comments

@sbernardjr
Copy link

When I browse albums in My Music/Browse Library on my Squeezebox, the album tracks are in the wrong order. This is the same if I browse the album list or the artist list, and is the same for my uploaded music or the All Access music I have saved to My Library.

Every album I have spot checked has been this way. There is no obvious order that the tracks have taken, but it appears to be consistent even after using Reload Library through the interface.

If I search and play the same albums under All Access, they are all ordered correctly.

If you want some specific examples or want me to post any debugging information, let me know.

@sbernardjr
Copy link
Author

Hrm. I realize I updated my API build to fix the streaming problems that came up a few weeks ago. I will see if I can update again or at least print my current version so you have that data.

@sbernardjr
Copy link
Author

Ok, I just cloned the latest build from the Develop branch of the API and reloaded the library and still the same result.

@hechtus
Copy link
Owner

hechtus commented Apr 7, 2014

Is it possible that this is related to issue #35? It so I already fixed it. It's not released yet.

@sbernardjr
Copy link
Author

Hrm. This is tracks within the albums themselves, so not sure. I will review my settings and see if there is anything obvious in the way the incorrect ordering of tracks is done.

@hechtus
Copy link
Owner

hechtus commented Apr 7, 2014

You could also check if the fix done here 292b282 solves your problem.

@sbernardjr
Copy link
Author

OK, this didn't solve my problem, but led me to look at the sorting under TrackMenu.pm (_sortAlbum, _sortArtistAlbum, etc).

I saw stuff like:

sub _sortTrack {
return ($a->{discNumber} || -1) <=> ($b->{discNumber} || -1) or
($a->{trackNumber}|| -1) <=> ($b->{trackNumber} || -1);
}

Not being super familiar with Perl subtleties myself, I took a sledgehammer approach and replaced every 'or' in these subs with '||':

sub _sortAlbum {
return lc($a->{album}->{name}) cmp lc($b->{album}->{name}) ||
($a->{discNumber} || -1) <=> ($b->{discNumber} || -1) ||
($a->{trackNumber}|| -1) <=> ($b->{trackNumber} || -1);
}

And that seems to have resolved it. Every album I looked at has the correct order now.

@hechtus
Copy link
Owner

hechtus commented Apr 7, 2014

Great! So the fix I've done will solve it. I will release a new version soon.

@sbernardjr
Copy link
Author

Oh, whoops, I didn't scroll down far enough to see you'd edited both files :)

Yup, confirmed your fix!

@hechtus
Copy link
Owner

hechtus commented Apr 12, 2014

Just released v0.3.7. Should be fixed now.

@hechtus hechtus closed this as completed Apr 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants