Skip to content

Commit

Permalink
Title: fix Remove the song from the playback of the album/artist. The
Browse files Browse the repository at this point in the history
song is still playing and is no longer in all music

Description:
bug : 18813 【音乐】【6.0.0.5】在专辑/演唱者中移除播放中歌曲,歌曲依旧在播放且所有音乐中已无该歌曲
RootCause:Null

Solution:
  • Loading branch information
tangpeng committed Apr 2, 2020
1 parent d8f66aa commit 0b88403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/music-player/presenter/presenter.cpp
Expand Up @@ -933,22 +933,19 @@ void Presenter::onMusiclistRemove(PlaylistPtr playlist, const MetaPtrList metali
next = playlist->removeMusicList(metalist);
}

if (playlist == d->player->curPlaylist()
|| playlist->id() == AllMusicListID || playlist->id() == "musicResult") {
//stop music
for (auto &meta : metalist) {
if (d->player->isActiveMeta(meta)) {
if (playinglist->isEmpty() || t_isLastMeta) {
onMusicStop(playinglist, next);
} else {
onMusicPlay(playinglist, next);
}
/*-----Judge the condition to remove the song playback switch -----*/
for (auto &meta : metalist) {
if (d->player->isActiveMeta(meta)) {
if (playinglist->isEmpty() || t_isLastMeta) {
onMusicStop(playinglist, next);
} else {
onMusicPlay(playinglist, next);
}
}
}

if (playlist->allmusic().size() == 0)
Q_EMIT musicListClear();

}

void Presenter::onMusiclistDelete(PlaylistPtr playlist, const MetaPtrList metalist)
Expand Down
2 changes: 1 addition & 1 deletion src/music-player/view/widget/model/musiclistinfomodel.cpp
Expand Up @@ -80,7 +80,7 @@ QModelIndex MusiclistInfomodel::findIndex(const MetaPtr meta)
return itemIndex;
}

qCritical() << "search index failed" << meta->hash << itemHash;
// qCritical() << "search index failed" << meta->hash << itemHash;

for (int i = 0; i < rowCount(); ++i) {
itemIndex = index(i, 0);
Expand Down

0 comments on commit 0b88403

Please sign in to comment.