Commit 2724e2b4 authored by Martin Seher's avatar Martin Seher Committed by Nate Graham
Browse files

Fix single track insert when playlist is shuffled

Wrong index is passed to beginInsertRows which messes up the displayed
information.

BUG: 442272
FIXED-IN: 22.04
parent d3c46049
Pipeline #143581 passed with stage
in 3 minutes and 42 seconds
......@@ -309,7 +309,7 @@ void MediaPlayListProxyModel::sourceRowsInserted(const QModelIndex &parent, int
if (d->mShufflePlayList) {
const auto newItemsCount = end - start + 1;
d->mRandomMapping.reserve(rowCount() + newItemsCount);
if (rowCount() == 0 || newItemsCount == 1) {
if (rowCount() == 0) {
beginInsertRows(parent, start, end);
for (int i = 0; i < newItemsCount; ++i) {
//QRandomGenerator.bounded(int) is exclusive, thus + 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment