Posts: 487
Joined: Jul 2012
Reputation:
6
2016-10-19, 15:47
(This post was last modified: 2016-10-19, 16:00 by fernandovg.)
why don't you clean "path" table if if strPath doesn't exist anymore OR if strPath begins with "http" ?
I have a bunch of paths in "path" that doesn't exist anymore and a lof of "http" there
UPDATE: seeing your code, you don't delete when protocol is "https://"
Posts: 8
Joined: Jan 2016
Reputation:
0
Hello sirs!
The addon shown is this thread seems to be exactly what I need, but sadly, I can't get it to work.
My problem: I have a huge library (somewhere between 3 and 4 TB of stuff). I recently switched from SMB to NFS for the shares containing these files, I rescanned the library and now everything shows double. Now I know that I should have removed the old sources and not changed them from SMB to NFS, but I guess that's too late now.
The usual Kodi Database Cleanup results in the system hanging up at 1% or even before.
I tried your tool several times, first with no funky settings, in the second run I tried to remove everything that starts with "smb://", but neither of which did anything. And the worst part is: I can't even find a logfile, nowhere on my machine, not in the tmp nor in the logfiles folder.
Any help is appreciated :-)
Posts: 8
Joined: Jan 2016
Reputation:
0
2016-10-21, 08:56
(This post was last modified: 2016-10-21, 08:57 by Gerdistan.)
Kodi 16.1 on a Raspberry Pi 3 (LibreELEC 7.0.2), Addon Version 0.5.6 (Dropbox Version)
Posts: 3,925
Joined: Sep 2013
Reputation:
365
OK. So, log files (both the kodi log & the add-on's log) should be in '~/.kodi/temp'.
I guess from the 'tmp' and 'logfiles' directories you mentioned, that you are accessing those from another machine on the network. Easiest way in that case to get the logs is to ssh to the pi (you can use putty if on windows) with a username of root and password of libreelec .
Once connected do cp .kodi/temp/*.log .kodi/userdata/ . Note that the spaces and dots are important !! That will copy the logs into the userdata directory which you can then access over smb to pull them off and read them.
If you set the add-on to create the database-cleaner log, then there should be some useful information in that (I hope !!)
Learning Linux the hard way !!
Posts: 8
Joined: Jan 2016
Reputation:
0
2016-10-21, 16:57
(This post was last modified: 2016-10-21, 18:20 by Gerdistan.)
Thanks for your answer - had a little trouble following your orders, at least on my RPi, the .kodi folder hides in /storage. But i managed to find the logs, which say....
ideo Database Cleaner V0.5.6 - Running at Friday, 21. October 2016 0808:21:04
There are 0 paths in the database that meet your criteria
The following paths were removed from the database
No paths have been found to remove
---
I think I have a hunch on the problem. I have several MyVideos*.db files in the Database folder, I guess the addon is checking one an kodi is using another. Will look into this tomorrow, gotta run now.
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Add-on checks the highest db No. it finds. So if you have upgraded or installed a beta or nightly and have a higher db version No, then that's what the add-on will connect to.
It's possible to correct this in the advanced settings of the add-on by specifying the correct name of the db to connect to. This can however lead to issues as the 'clean library' routine called by the add-on will attempt to clean the db connected to by the current version of Kodi. This may not be the same version if you have previously installed or used a beta/nightly version which has upgraded the databases.
Learning Linux the hard way !!
Posts: 152
Joined: Sep 2016
Reputation:
4
Hi,
I got the add-on to work for me before but for some reason it's no longer functioning.It starts for a second then errors out and says to check the logs.
The database-cleaner.log only has one line in it which is:
Video Database Cleaner V0.5.6 - Running at Saturday, October 22, 2016 04:12:20 PM
I also checked the spmc.log and saw found the following at the very end of the log after the database cleaner failed:
Error Type: <class 'sqlite3.OperationalError'>
Error Contents: Could not decode to UTF-8 column 'strPath' with text 'rtmp://89.248.172.239/live?wmsauthsign=c2vydmvyx3rpbwu9mtavos8ymde2idg6mzm6mzigue0magfzaf92ywx1zt0xm3jztwcxvk00cjivvlzpek1lajdbpt0mdmfsawrtaw51d
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/com.semperpax.spmc16/files/.spmc/addons/script.database.cleaner/default.py", line 742, in <module>
cleaner_log_file(our_select, False)
File "/storage/emulated/0/Android/data/com.semperpax.spmc16/files/.spmc/addons/script.database.cleaner/default.py", line 352, in cleaner_log_file
my_data = cursor.fetchall()
OperationalError: Could not decode to UTF-8 column 'strPath' with text 'rtmp://89.248.172.239/live?wmsauthsign=c2vydmvyx3rpbwu9mtavos8ymde2idg6mzm6mzigue0magfzaf92ywx1zt0xm3jztwcxvk00cjivvlzpek1lajdbpt0mdmfsawrtaw51d
-->End of Python script error report<--
16:12:22 T:1433397552 ERROR: Error loading addon settings to special://profile/addon_data/script.skinshortcuts/settings.xml
I am using SPMC, Metropolis Skin and database cleaner version 0.5.6
The only thing I think I remember installing between the last time I used this add-on when it worked and now is Rating Update v1.4.3 which I could not get to work so I uninstalled it.
Thanks in advance for any assistance
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Hi junitodx.
That error would appear to be occurring in one of the python modules that the addon uses to connect to the database. I don't have an android device to test with but in any case, I don't really think that it would make a difference.
As a start, if you disable the database-cleaner log file and try to run the addon again. That may let you actually do the clean without causing the error. If not, you should still be able to remove all streaming paths by turning OFF sources.xml in the settings. This should prevent the addon trying to determine which paths to remove or retain and just remove any streaming ones.
In the meantime, I'll try to reproduce your error, although if it is occurring inside the sqlite3 module (which it appears to be) then I doubt that there is much I can really do. I'll check out the SPMC packages to see if there is a version difference.
Learning Linux the hard way !!
Posts: 3,925
Joined: Sep 2013
Reputation:
365
Hmm, yeah....That would be an issue !!
TBH, the summary window is something I need to address fairly badly. At the moment, it's constructed totally 'on-the-fly' by the add-on. The only things in the actual skin file are the title, icon and the background. Everything else is written by making API calls to some stuff internal to Kodi. Problem with this is that it makes it look slightly different on different platforms and obviously in your case, it's failing to generate the buttons.
Assuming that those paths are correct, then if you turn off the summary window in the add-ons settings, it'll not show that window but instead proceed straight to the clean. This option was added for people who like to fire it once a week on a timer so that it can run without user intervention.
I know this is a bit of a hacky work-around but it should at least let you run it and clean your db up.
As I said before, I don't have a device that can run SPMC to test with, although I'm hoping to change that in a few days time !
Good luck....Please report back whether this works for you or not...And thankyou for the bug reports.
Learning Linux the hard way !!