Skip to content

Commit

Permalink
Merge pull request #22609 from ksooo/video-music-fix-playlist-order
Browse files Browse the repository at this point in the history
[video][music] Fix playlist item order. …
  • Loading branch information
ksooo committed Jan 29, 2023
2 parents 0e7541d + 87786c7 commit 16431ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion xbmc/music/MusicUtils.cpp
Expand Up @@ -553,7 +553,11 @@ void CAsyncGetItemsForPlaylist::GetItemsForPlaylist(const std::shared_ptr<CFileI
fileFormatter.FormatLabels(i.get());
}

const SortDescription sortDesc = GetSortDescription(*state, items);
SortDescription sortDesc;
if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_MUSIC_NAV)
sortDesc = state->GetSortMethod();
else
sortDesc = GetSortDescription(*state, items);

if (sortDesc.sortBy == SortByLabel)
items.ClearSortState();
Expand Down
6 changes: 5 additions & 1 deletion xbmc/video/VideoUtils.cpp
Expand Up @@ -173,7 +173,11 @@ void CAsyncGetItemsForPlaylist::GetItemsForPlaylist(const std::shared_ptr<CFileI
fileFormatter.FormatLabels(i.get());
}

const SortDescription sortDesc = GetSortDescription(*state, items);
SortDescription sortDesc;
if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == viewStateWindowId)
sortDesc = state->GetSortMethod();
else
sortDesc = GetSortDescription(*state, items);

if (sortDesc.sortBy == SortByLabel)
items.ClearSortState();
Expand Down

0 comments on commit 16431ec

Please sign in to comment.