Fix inconsistency between user interaction and database commit order when re-adding videos to the playlist

This commit is contained in:
Yingwei Zheng 2022-04-18 00:35:59 +08:00 committed by TobiGr
parent b50e3c07d2
commit 1cf670dad9
2 changed files with 24 additions and 2 deletions

View file

@ -158,6 +158,15 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
return headerBinding;
}
// Commit changes immediately when the user turns to the player.
// Delete operations will be committed to ensure that the database
// is up to date when the user adds the just deleted stream by the player.
public void commitChanges() {
if (isModified != null && isModified.get()) {
saveImmediate();
}
}
@Override
protected void initListeners() {
super.initListeners();