Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/library/dao/playlistdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ void PlaylistDAO::removeTracksFromPlaylists(const QList<TrackId>& trackIds, bool
++it) {
if (it.key() == trackId) {
const auto playlistId = it.value();
// keep tracks in history playlists
if (getHiddenType(playlistId) == PlaylistDAO::PLHT_SET_LOG) {
// keep hidden tracks in history playlists, remove purged tracks
if (!purged && getHiddenType(playlistId) == PlaylistDAO::PLHT_SET_LOG) {
continue;
}
removeTracksFromPlaylistByIdInner(playlistId, trackId);
Expand All @@ -967,6 +967,9 @@ void PlaylistDAO::removeTracksFromPlaylists(const QList<TrackId>& trackIds, bool
}
transaction.commit();

// We may now have empty history playlists. Remove them.
deleteAllUnlockedPlaylistsWithFewerTracks(PlaylistDAO::PLHT_SET_LOG, 1);

// update the sidebar
emit playlistContentChanged(playlistIds);
// If this is called by TrackCollection::purgeTracks() it will call
Expand Down