Bug 442272 - Playlist shows bogus track names when enqueueing tracks while shuffling is on
Summary: Playlist shows bogus track names when enqueueing tracks while shuffling is on
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 21.08.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-10 16:17 UTC by Nagy Tibor
Modified: 2022-02-28 21:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.04
Sentry Crash Report:


Attachments
Repro (414.44 KB, video/mp4)
2021-09-10 16:17 UTC, Nagy Tibor
Details
Repro (2022-02-24) (278.11 KB, video/mp4)
2022-02-24 15:41 UTC, Nagy Tibor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nagy Tibor 2021-09-10 16:17:35 UTC
Created attachment 141446 [details]
Repro

SUMMARY
There's a weird interaction between playlist shuffling and enqueueing things to the playlist. When playlist shuffling is turned on the playlist sometimes displays bogus tracks names after adding new tracks to it. Only the playlist labels are bogus, when those entries are played, they play the correct underlying song.

STEPS TO REPRODUCE
1. Turn playlist shuffling on.
2. Open an album and start manually enqueueing tracks in sequential order. 
3. After enqueueing a couple of tracks notice how the track names on the playlist are now bogus, there are several incorrectly repeated track names. 

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.3
Comment 1 Nate Graham 2021-09-10 17:47:40 UTC
Cannot reproduce, works for me.
Comment 2 Nagy Tibor 2021-09-10 18:53:45 UTC
Did you enqueued the tracks one-by-one and not with the "enqueue the whole album" button? That's an important step for repro. Only breaks when the tracks are manually added, the enqueue whole album button works properly.

Also this bug is a bit spurious, sometimes it may not manifest itself until you added 4-5 items to the playlist. I posted a worst case scenario in that video.

I checked this bug on git master, I can still reproduce it there. (git 0dd33183)
Comment 3 Nate Graham 2021-09-10 20:22:25 UTC
Yeah, I did do that.
Comment 4 Nagy Tibor 2021-09-11 10:22:36 UTC
Repro:
- Get KDE neon-unstable-20210905-0329.iso from https://neon.kde.org/download
- Start the live CD through VirtualBox
- Wait until the live CD boots to desktop
- Open Konsole
- $ sudo apt update
- $ sudo apt install elisa
- Close Konsole
- Open Elisa
- Hamburger -> Configure Elisa...
- Add New Location -> /usr/share/sounds
- Apply settings
- Wait until Elisa finishes importing the tracks
- Switch to the Tracks page
- Turn on playlist shuffling
- Enqueue tracks to the playlist one-by-one
- Watch the playlist get bogus

https://www.youtube.com/watch?v=98djTSvP6n8

This is the most controlled procedure and environment I could come up with. If this cannot reproduce it for you, I'm out of ideas.
Comment 5 Jan Paul Batrina 2021-09-11 11:43:41 UTC

*** This bug has been marked as a duplicate of bug 439596 ***
Comment 6 Jan Paul Batrina 2021-09-11 11:44:29 UTC
Sorry, marked the wrong bug report as a duplicate
Comment 7 Nagy Tibor 2022-02-24 15:41:45 UTC
Created attachment 147101 [details]
Repro (2022-02-24)

Still reproducible after those large playlist changes: https://invent.kde.org/multimedia/elisa/-/merge_requests/328

Operating System: KDE neon unstable
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Graphics Platform: X11
Comment 8 Bug Janitor Service 2022-02-28 17:53:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/331
Comment 9 Nate Graham 2022-02-28 21:07:46 UTC
Git commit 2724e2b4bedaaaa51b36053409eb641752c78f04 by Nate Graham, on behalf of Martin Seher.
Committed on 28/02/2022 at 21:07.
Pushed by ngraham into branch 'master'.

Fix single track insert when playlist is shuffled

Wrong index is passed to beginInsertRows which messes up the displayed
information.
FIXED-IN: 22.04

M  +1    -1    src/mediaplaylistproxymodel.cpp

https://invent.kde.org/multimedia/elisa/commit/2724e2b4bedaaaa51b36053409eb641752c78f04