Bug 271105 - Wrong album is played if 2 albums with same title but different artist
Summary: Wrong album is played if 2 albums with same title but different artist
Status: CONFIRMED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.8.0
Platform: Debian stable Linux
: NOR normal
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords:
: 311410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-16 16:55 UTC by gabriel.ruffieux
Modified: 2013-12-04 08:22 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gabriel.ruffieux 2011-04-16 16:55:25 UTC
Version:           2.3.2 (using KDE 4.5.1) 
OS:                Linux

If there is 2 albums with same title but from different artists, the next track played is the next track from the same titled album instead of current playing album.

Reproducible: Always

Steps to Reproduce:
1. I prepare a playlist with albums "You're Under Arrest" from Mils Davis followed by "You're Under Arrest" from Serge Gainsbourg.
2. I read my playlist randomly by album.

Actual Results:  
First track of album from Miles Davis is played.
Next track is the smallest ID of track from "You're Under Arrest" album that has not been played yet, so it is #1 from Gainsbourg's album.
Next track is #2 from Miles, then #2 from Gainsbourg, and so on...

Expected Results:  
First track of album from Miles Davis is played.
Next track should be #2 from Miles's album.
When album's finished, it should select another album randomly.

OS: Linux (x86_64) release 2.6.35-28-generic
Compiler: cc
Comment 1 Myriam Schweingruber 2011-04-17 17:55:06 UTC
That is really a corner case: having only 2 albums with the same name in the playlist is really very restrictive and doesn't give the random engine much of a choice. It would be definitely an error if it also did change album with a different name. Moving this to the wishlist.
Comment 2 Matěj Laitl 2012-10-11 23:14:09 UTC
(In reply to comment #1)
> That is really a corner case: having only 2 albums with the same name in the
> playlist is really very restrictive and doesn't give the random engine much
> of a choice. It would be definitely an error if it also did change album
> with a different name.

No, I think you misunderstood. This is an actual bug, "Random Albums" play mode should compare the albums by both album artist and album name, reverting back to normal prio.

Sam, didn't you fix something similar in Dynamic Playlists lately? Perhaps you can have a look a this, too? ;-) ^-^
Comment 3 Jörg Schaible 2012-10-12 14:57:06 UTC
Actually Amarok has major problems with albums that share the same name, but are from different artists (despite a correct album artist tag): https://bugs.kde.org/show_bug.cgi?id=216759
Comment 4 Myriam Schweingruber 2012-10-21 11:53:42 UTC
Matĕj, I assume you tested it with latest git, setting version accordingly :)
Comment 5 Myriam Schweingruber 2012-12-09 23:24:54 UTC
*** Bug 311410 has been marked as a duplicate of this bug. ***
Comment 6 Myriam Schweingruber 2013-04-11 09:31:14 UTC
Is this still valid with Amarok 2.7 or current git?
Comment 7 Jörg Schaible 2013-04-11 16:04:06 UTC
Still wrong in Amarok 2.7
Comment 8 Myriam Schweingruber 2013-04-12 07:02:49 UTC
Thank you for the feedback.
Comment 9 Konrad Zemek 2013-04-17 23:51:08 UTC
I submitted a patch for review:
https://git.reviewboard.kde.org/r/110070/
Comment 10 Konrad Zemek 2013-04-18 00:20:04 UTC
Let me comment some more on the issue.

It appears there are actually two distinct bugs here. The one I provided the fix for is directly connected with playlist sorting, where two albums were merged together on the playlist if they had the same name name but different artist - so very similar to https://bugs.kde.org/show_bug.cgi?id=216759 (although that one was for collection, not playlist).

I set up two albums with same name and different artist and got that merged result, so I automatically assumed it's that very bug mentioned here. So even after my fix, when playlist is sorted by album and album shuffle is enabled, the shuffle skips between albums playing the "next" track (like mentioned in first comment).

But this scenario (album shuffle when sorting by album) seems to cause bugs beyond these with identically named albums. I actually just got the same behavior with two different albums for different artists, and I'm frequently getting crashes while skipping to the next track.

So yes, there remains a bug here, and an annoying one. I'll take an in-depth look on it later today. If you happen to know if my fix covers an actual reported bug, please drop me a message.
Comment 11 Matěj Laitl 2013-04-27 09:11:17 UTC
Git commit 583158f4c4d25098aa1f0bb6b683813488580d52 by Matěj Laitl, on behalf of Konrad Zemek.
Committed on 27/04/2013 at 11:08.
Pushed by laitl into branch 'master'.

Cleaned up playlist multilevel sorting algorithm. Added album artist special case to playlist sorting.

It fixes an issue with two albums being merged on the playlist when they happen to have the same name, and sorting by album is enabled.
Originally thought to fix bug 271105, it actually fixes some other, but connected, one (see my comment https://bugs.kde.org/show_bug.cgi?id=271105#c10 ).

Thanks go to Konrad Zemek for the patch.

REVIEW: 110070

M  +114  -83   src/playlist/proxymodels/SortAlgorithms.cpp
M  +3    -0    src/playlist/proxymodels/SortAlgorithms.h
M  +19   -13   src/playlist/proxymodels/SortScheme.cpp
M  +11   -8    src/playlist/proxymodels/SortScheme.h
M  +2    -2    tests/mocks/MetaMock.h
M  +63   -44   tests/playlist/TestPlaylistModels.cpp

http://commits.kde.org/amarok/583158f4c4d25098aa1f0bb6b683813488580d52
Comment 12 Mikhail Ivchenko 2013-12-04 07:23:47 UTC
I tried to test it in amarok v2.8.0.
I have 4 songs in playlist: 
song #1 - artist#1
song #2 - artist#1
song #1 - artist#2
song #2 - artist#2
I start playing with random album option. 
Played:
song #1 - artist#1
song #1 - artist#2
song #2 - artist#1
song #2 - artist#2