New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[videodb] Fix TV shows cleaning after 5755573981ca706a82a7ecbbdf5de112a570377a. #8133
Conversation
@Montellese @mkortstiege ping |
No objections but i'd like to get @Montellese opinion as well. |
Ping |
@Montellese could you please have a look at this? |
"AND (exclude IS NULL OR exclude != 1))"; | ||
sql = "SELECT path.idPath, path.strPath, path.idParentPath, path2.strPath AS strParentPath " | ||
"FROM path " | ||
"LEFT JOIN path AS path2 ON path2.idPath = path.idParentPath " |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Please wait. This breaks multiple movies in the same folder: Suggestions welcome. |
Looks like in that case Edit:
|
@anaconda would this still something for Jarvis or too risky? |
Too risky for Jarvis unless |
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
46ea4b6
to
5f4ef0c
Compare
No chance of this getting into 16.1 then? |
@anaconda is this still wanted/needed? |
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. |
@menakite will you revisit this? |
@anaconda this needs a rebase |
I will close this PR. If there's interest please open a new one (with required changes if needed). |
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 noticeableafter 5cae3b5.
After 5755573:
CleanMediaType
would return adecision for the TV show path (delete) and a decision for the parent path
(keep), so the TV show wasn't removed from the database;
CleanMediaType
would returnearlier and
pathsDeleteDecisions
was empty, so we'd have checked if thepath 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:
The 2 booleans are just to improve readability.