Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 20
  • 21
  • 22(current)
  • 23
  • 24
  • 39
v19 Video Database Cleaner add-on
Distinctly odd then !!

 For a query of
Code:
SELECT strPath FROM path WHERE idPath IN (SELECT idPath FROM path WHERE (strPath LIKE 'smb://%' ));
I get a result of
Code:
519 rows in set (0.02 sec)

And for
Code:
mysql> SELECT strPath FROM path WHERE idPath IN (SELECT idPath FROM path WHERE (strPath LIKE 'nfs://%' ));

I get
Code:
1413 rows in set (0.06 sec)

Those are the same type of queries the addon should be forming.  Now, I know for a fact that some of those nfs paths are no longer valid as they relate to 'sdb1' which gave up the ghost a while ago. Indeed, extending the query to just that path reveals 231 entries that are actually defunct and need to be removed.  I'll run the addon against the db later when I get back home and see what happens.

Oh, just to be clear, the way the addon should be working is to run the select query to show the paths to be deleted and then run the same query but using 'DELETE FROM files' WHERE idPath in.....  That should remove the entries from the files table, and then Kodi's own internal clean library routine should remove all the associated stuff from the other tables.

NOTE - DO NOT run one of the above commands with the delete statement substituted for select, otherwise you WILL delete stuff from your db !!  The addon is more selective in that it works by selecting paths that DON'T match it's criteria.  E.G. WHERE strPath NOT LIKE 'nfs://%' AND strPath NOT like 'smb://someserver/%' The idea being that if we exclude everything we think should be there, then everything else is safe to remove.
Learning Linux the hard way !!
Reply
I just wanted to thank you for this add-on.

I was experiencing 100% CPU resource use during video playback, which was causing stuttering and other performance problems. I had library cleaning times of around an hour.

After using this add-on exactly once (and cleaning out over 1100 identified problems), the resource issue has vanished and library cleaning takes just a few seconds.

It's rare that such an irritating problem is so easily solved. I can't believe this add-on is not part of the standard kodi installation.

Thanks again!
Reply
It seems the addon doesn't cleanup non-exist sub folder under the source that is added to Kodi file manager. Is this by design? The folder has been deleted, but the path of the folder and paths to all files under the folder are still in the database after library cleanup with Kodi and the database cleanup with this addon. I know there is way to add the path explicitly to clean it up, but for many of these, it's tedious to do it manually.
Reply
OK, so..... The addon was designed originally to clean streaming links which kodi adds (un-necessarily) to its video database.  Removing a whole path was added as an afterthought feature because I thought it might be useful in some cases.  Kodi itself allows for removable and/or unobtainable files on NAS/USB drives in case those drives/files are offline for a reason.  If you remove your sources correctly in Kodi, then the associated data should also be removed.  If however, you just delete the source and/or edit your sources.xml file, Kodi (and the addon) has no way of telling if the directory/files are merely offline or have been deleted.

Removal of a full path is by design a one-shot deal.  This is to try and prevent people making mistakes and removing something that shouldn't be removed.  Tedious or not, if you have deleted folders/directories and not removed the sources via Kodi, this is the only way to remove them completely.

If this were made easier, doubtless many users would be complaining the addon had removed stuff that they wanted to keep. It already messes in a database with a method that the Kodi team would rather it didn't which is why it'll never be in the official addons (even though it does a decent job and probably should be !).  It can't account for every eventuality, nor should it make (any more) guesses as to whether or not a source is valid.  It gives the user the tools to remove any path should they choose to do so and although this isn't the easiest thing to do, there are valid reasons for the way it is now.
Learning Linux the hard way !!
Reply
I believe you are absolutely correct. Unfortunately, some like myself, didn't un-install the sources properly in Kodi at the time. Still not sure the proper process for doing that; though I'll try to learn it the next time I have remove links to sources. At least with your plug-in we can remove them manually.
Reply
(2018-12-03, 01:58)themusj Wrote:  Still not sure the proper process for doing that
See here... https://kodi.wiki/view/Updating_or_remov...om_Library
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
Hey there,
don't know if it's worth keeping up with this discussion seeing the last answer, just let me know if we're not in a "supported" use case.
I also have this problem and in my case, it was caused by editing the source.
I changed my NAS IP address, so I got into the source, trough the GUI, edited the IP address and just validated.
Of course, no warning, or a popup asking me about the library, was shown.

After that Kodi just started to be messed up and the cleaning function completely stopped working (even making Kodi freeze). that seems to be a known bug.

I ran your script and Kodi stopped acting up, and the cleaning function started working again.

In the GUI I still had folders for the series (in that case) from the old path, but they were empty. I was able to remove them manually.

Anyway, after that, your script still see reference to those folders and fail to delete them.

at this time this path is not in the source, it was still in my "network location". I don't know if that's a Kodi feature or a libreelec one and as I'm not running Kodi in English I'm not sure that it's the right translation.
I deleted it from there a reran the script with no luck.
Reply
Umm, sources not removed correctly (ie, showing in sources.xml but actually not really existing any more) is something I intend to look at in the new year. 

That said, the addon, for reasons I have already pointed out, can't just go and delete stuff 'willy-nilly' so it may be that I will add some sort of setting or something to allow removal of those paths whilst not being something that happens by default.  Dunno yet...... requires some thinking about !!

I have also had a request on github to allow some leeway when excluding something.  EG instead of excluding ALL of the youtube videos, just keeping the last 10 and removing the others.  This seems to me like a good idea and a feature worthy of inclusion, but the exclusion code will need a major re-write to achieve it as it currently takes no account of how many items are in an excluded path.  Again, one for the new year, but one I am hopeful to include sooner rather than later.
Learning Linux the hard way !!
Reply
(2016-04-30, 20:46)BatterPudding Wrote: Get your lovely Add-On here.

Black Pudding Repo: removed due to abuse of bandwidth

The original repository currently only holds 5.4.0, and is left here purely for audit purposes; the latest version is now available from the following repo:

https://github.com/the-black-eagle/repos...-0.1.0.zip

... with master code here:

https://github.com/the-black-eagle/scrip...se.cleaner
 
 The URL to the .zip file is no longer working, where can I get it instead?
Reply
See page 20.
Reply
Or you can download the zip from the releases page on github and install it manually. https://github.com/the-black-eagle/scrip...r/releases
Learning Linux the hard way !!
Reply
(2018-12-24, 10:33)black_eagle Wrote: Or you can download the zip from the releases page on github and install it manually. https://github.com/the-black-eagle/scrip...r/releases
Thanks!
Reply
This utility seriously needs to be included in the Kodi core program add-ons, IMHO.
My Media Cleanup time went from 15 minutes to 15 seconds. 
THANK YOU! THANK YOU! THANK YOU! THANK YOU!
Reply
^
agreed.

Either team Kodi should fix their own database clean function to include such features that this addon provides OR they should relax their rules and make an exemption to allow this addon within the Kodi repository. IMHO, anything less seems just pigheaded overly bureaucratic.

Sadly it’s all been discussed many times previously with no good outcome from the users perspective... Instead, one has to know that this addon exists, that it will actually fix their database issues, and where to install it from. It’s hardly an ideal situation for what should be a Kodi core function.

There, I’ve said it Blush

Ps: I’ve still only got respect for team Kodi and the many addon authors that make Kodi as great as it is so take my post as positive criticism.

PPS: happy new year to one and all Big Grin
I'm a XBMC novice :)
Reply
That helps to speed-up the lib clean-up, thanks!
Reply
  • 1
  • 20
  • 21
  • 22(current)
  • 23
  • 24
  • 39

Logout Mark Read Team Forum Stats Members Help
Video Database Cleaner add-on5