winampify
winampify copied to clipboard
Loading .m3u of an album leads to inconsistent playlist
I opened the .m3u of an album to fill the playlist with the whole album. The tracks actually appear an are playable, but the playlist contains duplicates of the tracks. There seems to be some kind of reference/id duplication as well, as selecting one track also automatically selects its "twin". For some tracks, skipping to the next track works, but for some it jumps back, probably because the twins get mixed up.
This screenshot shows how it looks after loading the .m3u:
I did not dig around in the code or did any investigation on my own. If I get some hints on where to start, I'll gladly support as good as I can.
Awesome project btw. ;-)
I just tried with some other albums, it does not happen for all of them. I just had bad luck with the very first one that I picked, which was "The Fragile" by Nine Inch Nails. For that album, however, it is reproducible.
I see two possible causes:
- This is a album with 2 CDs (12 + 11 tracks). The Spotify client shows the tracks like this:
Not sure how this comes out of the API… The listed tracks in Winampify are all tracks from CD 1. The duplication makes 20 tracks out of the 11…
- I also have a (Spotify) playlist (named "Nine Inch Nails – The Fragile"), which contains all 23 tracks of both CDs in a single flat list. However I don't think Winampify loads/searches playlists, right?
Hey @yogan, thanks for reporting this!
I could reproduce the bug with all albums with multiple CDs, the problem is that the code is using the track_number
property to load the track one by one based on the total number of tracks in the album.
On CD 2, it's going back to 1, though. So the code just goes through CD 1 twice. A good start would be to use the disc_number
property sent by the API to cycle to the next CD.
The repo is undergoing a massive refactoring at the moment. The live app on winampify.io has almost nothing to do with the current version in the repo (see https://github.com/remigallego/winampify/pull/1). I hope I can have a stable version by the end of the month! I would really appreciate contributions once we're there. :)
It's really a minor issue, as this CD thingy is pretty much a relic from the past. ;-) I haven't seen it very often in Spotify.
If I find some spare time, I might spin up the latest dev version and take a look. Good to know that the deployed app is outdated, so it probably makes no sense to start any debugging efforts there.
@yogan Just a heads up that I've disabled this functionality for now. I'm working on a better, more extensible support for playlists for the next version.