Posts: 16
Joined: Aug 2015
Reputation:
0
Ladida
Junior Member
Posts: 16
Thanks for creating this addon!
I have followed this tread (and the previous) since the start, but only now got around to try the add on.
The setup went smooth and it ran without problems.
The question I have, is where can I see what was deleted?
I had debug mode enabled in the addon (not in Kodi), and I have checked the database-cleaner.log, and found only like 40 rows there, Is there more statistics available?
Can I see what SQL statments that was run?
Posts: 16
Joined: Aug 2015
Reputation:
0
Ladida
Junior Member
Posts: 16
Ok, I see.
Missed that part about enabling also the Kodi debugging. Maybe the script could warn the user or give the option to enable Kodi debugging before running the script if debugging is enabled in the settings.
(On the other hand you could argue that users that use debugging should be able to read the full instructions, unlike me)
I will give it a go again with both debug settings enabled, just out of curiosity to see what SQL statment that will be created.
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Well, perhaps it isn't crystal clear in the instructions.
Part of the reason is add-ons are not supposed to write debug info into Kodi's standard log, only when this is enabled for Kodi itself. I'm not sure if it is possible in the add-on settings area to depend upon a systemwide setting being enabled although it is certainly possible to add some text underneath clarifying that Kodi's debugging should also be enabled. It's a good point and one that will be addressed in the next release version either by the script checking the systemwide setting at runtime, or by adding some text below the debugging option in the settings.
Your SQL statement should be something along the line of -
DELETE FROM files where idPath in(SELECT idPath from path WHERE(strPath NOT LIKE 'some/path/in/sources%' AND strPath NOT LIKE 'another/path/from/sources%'));
Can be quite long depending upon the size and quantity of the paths in sources.xml
If you don't have any defined sources (some people just use files view) or you just want to quickly remove streaming links, then turning OFF 'use sources.xml' in the add-on settings will generate the following SQL
DELETE FROM files WHERE idPath IN (SELECT idPath FROM path WHERE ((strPath LIKE 'rtmp://%' OR strPath LIKE 'rtmpe:%' OR strPath LIKE 'plugin:%' OR strPath LIKE 'http://%')));
Again, you can add some exlcudes to this with the exclude.xml file.
Learning Linux the hard way !!
Posts: 3,925
Joined: Sep 2013
Reputation:
365
OK, that's a little weird !!
idFile is definitely a column within the database, so just from that little snippet, it's hard to guess what has gone wrong.
Is there any chance that you had debugging turned on in both the add-on and Kodi ? I don't need the full log, just the bits that the add-on writes into it. If you don't have the log, do you think you can reproduce the error (with the same settings you used before) but with both Kodi's and the add-on's debugging enabled and post up a link to the log somewhere so that I can try and figure out what exactly has gone wrong ?
Thanks.
Learning Linux the hard way !!
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Thanks. Looks like an issue with keeping bookmarks. I'll see if I can reproduce this and figure out a fix !!
Learning Linux the hard way !!
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Thanks for testing !! I'll look at this as soon as I can. There are actually two errors there. One is a python error which is easily fixed, the other is an SQL issue which will require a bit of thinking about. I know what is causing it, I'm just not completely sure yet as to the solution lol
Learning Linux the hard way !!
Posts: 315
Joined: Mar 2013
Reputation:
7
2016-06-30, 09:08
(This post was last modified: 2016-06-30, 09:09 by Sunflux.)
Excellent! Exactly what I was looking for.
My OpenElec installation has been hanging for about 5 minutes at 99% cleaning, and I couldn't even abort at that point, I had to wait it out. I knew I could solve the issue by deleting and recreating the database, but I had a lot of folder customization and a huge amount of watched/bookmark status (of existing files) I didn't want to lose... and this worked great! Only took about 5 seconds to run, and now cleanup is as good as instant.
Kudos!