Kodi Community Forum

Full Version: MYSQL doesn´t remove old paths and files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Community,

I´m using KODI 14.2 with a MYSQL-Database.

Everything is working fine, but I have seen the following behavior, I don´t understand:

If I delete a move / TV-Show (as I like to move it to another Share and import it again), the move /Epsiode get´s deleted corretly in the according table.

Neverthelesss, the entries in the table "path" and "file" remain, so I have doube-entries.
These "old" entries have no further reference, but are still in the database.

Is this a bug?

Wouldn´t it be better, to delete also the according file and path entries of the affected tables?

Looking forward to get some feedback.

Chris
Kodi also tracks watched status on plain video files, so that data is stored in the video DB even if it is not associated with a library entry. In other words, this is intentional.

That being said, it would be neat to have some way to clear out really old data, or anything not associated with the library. Maybe as some kind of advanced DB cleaning option.
Hi Ned,

thank you for your reply.

I understand, that according information like "watched status" etc. is stored in the video DB, so with the file, etc.
As far as I know, all this information will be exported, if an according library-export is initiated in Kodi.

So my assumption is, that if a movie/episode is deleted, the affected "files" and "paths" are also deleted, as there will be no more usage of it, right?
Or do you refer to the scenario, that if I´m going to import a move/epsiode again (and the movie is still on the same location, as it was before) this data will be reused?
To be honest, I haven´t tried to "re-import" ressources from the same location, and taking a look into the database, whether existing entries are re-used or not.

If this is the case, I understand the intention, do not delete this entries.

Nevertheless, it would be nice to have an option to really clear out this data, so, as you suggested, some kind of advanced DB cleaning option.

Currently, I cleaned-up my MYSQL-Database manually, and in the future, I will not delete movie in my library, and re-import I will just simply change the path directly in MYSQL Smile

Best Regards,
Chris
I believe it is a case where someone just hasn't added a prompt for removing paths as well. For example, removing something from the library, or removing an entire source, could prompt something like "would you also like to remove all watched data and other info associated with these files?". Or maybe some kind of automatic purging of "old" file-only data after a certain length of time. There's several ways to go about it, and several different use cases for Kodi that would need to be considered. Then there's actually writing that code, and making any possible settings, user defined or not, logical.

I'm not a dev myself, but I do know that there has been a lot of talk about various "garbage collection" tasks that we should implement, and I imagine this would fit in well with what they might have in mind. Kodi can be quite the packrat right now.
Hi Ned,

yes, in principle, this is what I´m looking for, performing an according clean-up, once data it deleted/removed in library.

To whom / in wich part of the forum, can I address this, as this is now more a feature-request Smile.

Thanks and Regards,
Chris
Please file a feature request ticket at http://trac.kodi.tv.
(2015-07-06, 09:02)mkortstiege Wrote: [ -> ]Please file a feature request ticket at http://trac.kodi.tv.

We don't use trac for feature requests anymore, so they just get closed. I believe this was because no one ever bothered to check trac for FR, and the posts on the forum got more attention, so we just tell people to post in the FR forum instead.