Move database room deletions to be consistent with saves#771
Merged
Conversation
Currently emptying a room with an empty playlist fires off two transactions which get run together: - update the room db entry (with nothing useful) - delete the room db entry Usually the DELETE is processed first and then INSERT OR REPLACE adds the room back to the database. Although the room is gone from the GUI, it will pop back into existence when the server is restarted. This change simplifies the logic to always delete the room from the database when the playlist is empty (regardless of whether there are watchers).
Contributor
|
Nice catch! |
Contributor
|
Is this compatible with #754 which adds playback speed support? |
Contributor
Author
|
Yes it applies and works fine. That PR doesn't bother storing the room speed in the database, but even if that gets added it shouldn't be an issue. |
Contributor
|
@gavtroy Great, I've tested it and it seems fine so I'll be accepting the PR. Thanks for your work on this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently emptying a room with an empty playlist fires off two transactions which get run together:
Usually the DELETE is processed first and then INSERT OR REPLACE adds the room back to the database. Although the room is gone from the GUI, it will pop back into existence when the server is restarted.
This change simplifies the logic to always delete the room from the database when the playlist is empty (regardless of whether there are watchers).