Skip to content
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

Respect parent path decision when cleaning paths. #5524

Merged
merged 1 commit into from
Oct 28, 2014
Merged

Respect parent path decision when cleaning paths. #5524

merged 1 commit into from
Oct 28, 2014

Conversation

anaconda
Copy link
Contributor

When cleaning the video library and a source containing TV shows was unavailable,
choosing to keep it only kept the source root, while subdirectories were
removed.
The result was that TV shows "disappeared".

This is fixed by checking if there's a decision for the parent path when
cleaning the path table.

See: #5324 (comment)

When cleaning the video library and a source containing TV shows was unavailable,
choosing to keep it only kept the source root, while subdirectories were
removed.
The result was that TV shows "disappeared".

This is fixed by checking if there's a decision for the parent path when
cleaning the path table.
@fritsch
Copy link
Member

fritsch commented Oct 17, 2014

If that does, what I think it does, it has my +1 but needs @Montellese for review.

Thanks anyways for improving xbmc.

@Montellese
Copy link
Member

I think this looks ok but I'm not sure if it will always work. I think it only works under the assumption that the directory structure is <tvshow> --> <season> --> <episodes> because otherwise idParentPath won't point to the "proper" parent path.

PS: I'm working on some additional logic that should better handle sources on unavailable machines as well but didn't know this was an issue.

@anaconda
Copy link
Contributor Author

I've just tested this
source -> tvshow -> seasons1-3 -> 1 -> episodes1-5 -> 1x03.flv
and it wasn't deleted:

sqlite> select * from path where strPath like '%fake-source%';
74|/Users/anaconda/tmp/fake-source/|tvshows|metadata.tvdb.com|F137663F66518FE9959D8EEB74E997D0|0|0|<settings><setting id="absolutenumber" value="false" /><setting id="dvdorder" value="false" /><setting id="fanart" value="true" /><setting id="language" value="it" /></settings>|0|0||
75|/Users/anaconda/tmp/fake-source/Arrow/|||F7F2F8980B996148B8B2CB65CB5536E5||||||2014-10-17 18:38:53|74
76|/Users/anaconda/tmp/fake-source/Arrow/seasons1-3/1/episodes1-5/||||||||||
77|/Users/anaconda/tmp/fake-source/Arrow/seasons1-3/1/episodes1-5/1x03.flv/||||||||||76

Can you suggest a different structure where you think this wouldn't work?

Edit: note that the query only SELECTs the TV show subdirectory, after that you can have whatever you want:

sqlite> SELECT path.idPath, path.strPath, path.idParentPath FROM path WHERE NOT ((strContent IS NULL OR strContent = '') AND (strSettings IS NULL OR strSettings = '') AND (strHash IS NULL OR strHash = '') AND (exclude IS NULL OR exclude != 1));
[other sources]
74|/Users/anaconda/tmp/fake-source/|
75|/Users/anaconda/tmp/fake-source/Arrow/|74

In current master 74 is kept, but 75 is removed.

anaconda pushed a commit to xbianonpi/xbian-package-xbmc that referenced this pull request Oct 26, 2014
@Montellese
Copy link
Member

Sorry, forgot about this one. Should be good to go in @topfs2 @MartijnKaijser.

@Montellese Montellese added the Type: Fix non-breaking change which fixes an issue label Oct 28, 2014
@Montellese Montellese self-assigned this Oct 28, 2014
@MartijnKaijser
Copy link
Member

jenkins build and merge

@MartijnKaijser MartijnKaijser added this to the Helix 14.0-alpha5 milestone Oct 28, 2014
@jenkins4kodi jenkins4kodi merged commit cfd0aa1 into xbmc:master Oct 28, 2014
@anaconda anaconda deleted the vclean-deletes-tvshows branch October 28, 2014 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Fix non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants