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

Spotify albums now have duplicate tracks #3429

Closed
Clementine-Issue-Importer opened this issue Dec 13, 2013 · 7 comments
Closed

Spotify albums now have duplicate tracks #3429

Clementine-Issue-Importer opened this issue Dec 13, 2013 · 7 comments

Comments

@Clementine-Issue-Importer
Copy link

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From cincoden...@gmail.com on January 14, 2013 21:51:05

I love the new better-unified search, BUT since upgrading to 1.1, my many Spotify albums I search for end up with duplicate tracks that are added to the playlist and play through. What steps will reproduce the problem? 1. Sign in with Spotify and search for an album (e.g. Mylo Xyloto by Coldplay)
2. Observe duplicate tracks under the Spotify listing
3. Replace playlist with that album
4. The duplicates will show up in the playlist and play through What is the expected output? What do you see instead? I expect that each track will only show up once in the vast majority of albums, but frequently on albums that I know don't have weird numberings, duplicate tracks show up. I didn't see this behavior in previous versions, as recently as 1.0.1. What version of the product are you using? On what operating system? Clementine 1.1.1 on Slackware64, compiled from source via SlackBuilds Please provide any additional information below. On Mylo Xyloto, track 3 is duplicated. Other examples:
Flood by They Might Be Giants - tracks 2, 4, 7 duplicated
Up All Night by One Direction - tracks 1-13 duplicated
Tracks are usually, but not always, the same length - the first two tracks of Up All night are different lengths.

I expect this kind of nonsense from Grooveshark, whose album data is pretty horrendous, but Spotify's data is much cleaner, and as stated, previous versions didn't have this issue. I haven't looked into the issue enough yet to determine if it is a problem actually within Clementine, or something upstream with the plugin or Spotify, but in the latter case if a workaround is possible, it would make Spotify much less frustrating again.

Attachment: spotify_bug.png

Original issue: http://code.google.com/p/clementine-player/issues/detail?id=3429

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From cincoden...@gmail.com on February 01, 2013 21:10:55

I've been investigating this issue, and here's what I've found so far:

From what I've discerned, the Spotify service sends a list of albums and a list of free-floating tracks. The previous global search box would properly list each track and album independently, and if there were multiple versions of the same album, it would group them into one entry in the list, and then show them independently on mouse-over.

What appears to be happening now is that the Spotify search provider now just takes each song individually, appends it into one big list, and groups them by album name. This results in duplicates, triplicates, and even quadruplicates as Spotify has a couple versions of the album, as well individual entries for the song.

I've partially confirmed this by commenting out the section of code that adds the individual results from the list, which eliminated duplicates from the Foo Fighters' Greatest Hits, as shown in the attached screenshot.

Attachment: foofighters.png

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From cincoden...@gmail.com on February 01, 2013 21:34:47

Here is a clearer picture of what is happening. I modified the search provider so that when it was looping through the albums from the Spotify service, it prepended the album loop index to the album title for each track - so that each album provided by the Spotify service would have a unique title. As expected, this resulted in multiple albums of the same title, but each with a complete, non-duplicated tracklist. There is also an non-prepended album with a few selected tracks - these are the ones provided in the result() list. I've attached a screenshot showing the difference, and a diff file showing the changes I made to the source.

Attachment: onedirection.png indexed.diff

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From cincoden...@gmail.com on February 02, 2013 02:24:39

Okay, I've managed to get what I think is a pretty clean, sensible solution to this. I added a field to the Song struct called album_id_ that holds an (optional) unique identifier for an album, so that for a service like Spotify we can differentiate between different albums with the same title. This unique ID is appended to the album title for grouping purposes, but not displayed anywhere, so the results are exactly what I was looking for. I've attached my patch and an updated screenshot, and also uploaded my changes to my github at https://github.com/cincodenada/clementine-player

Attachment: onedirection_fixed.png spotify_dup_patch.diff

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From davidsansome on February 02, 2013 06:06:07

This issue was closed by revision 9578c6c .

Status: Fixed

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From davidsansome on February 02, 2013 06:06:46

Thanks very much for the patch! I've committed it with a couple of minor changes.

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From cincoden...@gmail.com on February 02, 2013 13:07:55

Awesome, thanks a lot!

@Clementine-Issue-Importer
Copy link
Author

@Clementine-Issue-Importer Clementine-Issue-Importer commented Dec 13, 2013

From john.maguire on February 11, 2013 08:53:18

This issue was closed by revision bb7a1e6 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.