[videodb] Fix TV shows cleaning after 5755573981ca706a82a7ecbbdf5de112a570377a. #8133
A regression in 5755573 meant removing a
This commit checks if there's a decision to delete the parent path or it
The 2 booleans are just to improve readability.
Looks like in that case
A regression in 5755573 meant removing a deleted TV show needed multiple library cleanings (i.e. TV shows only got removed when filesToTestForDelete was empty). This is much more noticeable after 5cae3b5. After 5755573: * if we had files to be checked for deletion: CleanMediaType would return a decision for the TV show path (delete) and a decision for the parent path (keep), so the TV show wasn't removed from the database; * if no files needed to be checked for deletion: CleanMediaType would return earlier and pathsDeleteDecisions was empty, so we'd have checked if the path existed and there was a decision for the parent path (delete) or no decision at all. This commit checks if there's a decision to delete the parent path *or* it exists (we only end up there if there's a decision to delete the path or it doesn't exist), so that you can delete a TV show with episodes (or other random files). See: * http://forum.kodi.tv/showthread.php?tid=238881
Actually your fix needs some improvements.
Example, I am using a movie structure like:
Following part of the if-statement (in VideoDatabase) wipes an entire folder (removes all movies in the folder from the database), when I delete only ONE movie in the folder and execute a "clean video library":
This issue is super annoying for me and my folder structure. Because any time I delete a movie, like 200 movies getting removed as well from my kodi database.
It works correctly, if I change
@anaconda this could also be a fix for your last comment/worries on Oct 25, 2015.
I opened PR11937 that includes the fix and some of your/this improvements for better readability of this part.