Files not cleaned when a source is removed
#1
Video 
I believe there is a bug in CGUIWindowVideoBase::OnUnAssignContent() and more precisely in
the RemoveContentForPath() call.

I have noticed that, when removing a source, some items are not cleaned from the db. After investigations, it seems the concerned items are always contained inside a container like a zip file. For instance, all the path starting with "zip://" are not removed when they should, creating orphan items in the db.

I have tracked the problem down to RemoveContentForPath(), but I am not able to understand the exact cause of the issue. There might be other cases for a file not being cleaned when removing a source, I have seen at least another occurrence (but this other time I could not identify the possible cause).

For information, all the items are cleaned when using the "Clean Library" function from the Settings menu (under Video/Library in my case).

Do you have any tip on a way to solve this issue? I would be happy to propose a patch if I am pointed in the right direction...

Pierre
Reply
#2
We have an add-on in the pipeline that addresses just such an issue. I must admit I hadn't thought of a zip:// path, but it'll still get removed regardless.

http://forum.kodi.tv/showthread.php?tid=272112

Release should be later today or tomorrow at the latest.
Learning Linux the hard way !!
Reply
#3
To be honest, I am having a hard time trying to understand how this can be solved by a plugin... this seems like a plain regular bug to me. When removing a source and selecting the "clean database items" option, one would expect all the related items to be cleaned from the database, it shouldn't need a plugin to be installed.

Maybe I am missing something here, but why is this not included in Kodi's main source?
Reply
#4
(2016-05-01, 22:45)pbureau Wrote: To be honest, I am having a hard time trying to understand how this can be solved by a plugin... this seems like a plain regular bug to me. When removing a source and selecting the "clean database items" option, one would expect all the related items to be cleaned from the database, it shouldn't need a plugin to be installed.

Maybe I am missing something here, but why is this not included in Kodi's main source?

Totally agree that it's down to the Kodi core. Currently however, the core does not clean the database completely. For instance, it never touches anything that references a plugin path, files played through file manager or anything that was played via an http/rtmp/rtmpe stream. It does however insert these into the database but as they are not related to a source path, the current clean library routine has no method of removing them.

Our program add-on does remove them, and anything else not defined in your sources.xml file.
Learning Linux the hard way !!
Reply
#5
to bad time is invest by the community for writing an addon instead of trying to solve it the proper way
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
(2016-05-02, 09:43)Martijn Wrote: to bad time is invest by the community for writing an addon instead of trying to solve it the proper way

Well, if I thought my C++ skills were up to it, I'd give it a go. Sadly I don't believe they are, so an add-on was the next best option.

The benefits of an add-on are however that the user has more control over what is and isn't removed. It doesn't just blindly delete stuff, rather the user can set it up so that for instance, all the youtube links are removed whilst keeping all the itunes trailer links. This preserves the watched list for that add-on.
Learning Linux the hard way !!
Reply
#7
(2016-05-02, 09:43)Martijn Wrote: to bad time is invest by the community for writing an addon instead of trying to solve it the proper way

When asked why Wikipedia had so many Python-based bot users to do various tasks, instead of including those functions in the core MediaWiki program, the reply was that there will always be more Python authors than coders for MediaWiki. Especially considering how daunting and complicated MediaWiki code had become. Sounds a little bit like Kodi and how much Python add-ons are used :)
Reply

Logout Mark Read Team Forum Stats Members Help
Files not cleaned when a source is removed0