[videodb] Movie Deletion/Conversion to Version Refactor and Optimization #25022
+41
−39
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.
Description
Minor refactor and optimization in movie deletion and conversion of a movie into a version.
See motivation and context for the "why".
One commit per logical step, as follows:
[refactors]
[small optimization]
No backport to v21, there is nothing broken to fix.
Motivation and context
Prompted by an investigation of what happens after a movie is turned into a version, and the user refreshes the library or adds the movie to library again from Videos node.
There is no crash and things work fine, but a small optimization can be made to the hash: it's deleted when converting a movie into a version, but recreated (even though there is no file/folder change) in the next library scan / explicit scan of the movie.
Instead, the hash could be preserved and the next scan will be a little faster (detect the folder as "no change" instead of "new")
Then noticed that the parameters of the DeleteMovie are a bit strange and could use a bit of refactoring.
How has this been tested?
Deleted movies, converted movies to versions
Tried different scraper settings (single movie in folder named after the movie or not, recurse or not)
"Library Update" function, "Scan to library", "Scan source"
What is the effect on users?
Barely noticeable - slightly faster library scan after converting movies to versions
Types of change
Checklist: