Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 22
  • 23
  • 24(current)
  • 25
  • 26
  • 39
v19 Video Database Cleaner add-on
(2019-02-25, 22:26)MAX404 Wrote: Hi everyone

I installed this add on on my Nvidia Shield TV Pro running a Kodi version 18.1 , with Guilouz skin on top , i could not make it work , every time i run it I got error:

No sources.xml
Cleaner error

I selected and deselected both of this options

Sources
Uses sources.xml to determine files to keep - STRONGLY recommended. Otherwise the database clean will remove only rtmp:// rtmpe:// addon:// http:// references
Uses sources.xml on this machine - lets you supply a list of sources from a different location (needed for MySQL users, shared sources.xml, network locations, etc)


but the result is the same, I do not have a sources.xml

What I am doing wrong?

Hi

The reason for the error was i had no sources.xml , somehow during the upgrade from 17.6 to 18 (or 18.1) the went missing , turn off both of my NAS i run the clean library routine , it asked me if i want it to delete the missing sources , afterwards i re installed the sources again and the error is gone

I still have a minor issue , it shows that active data base is MyVideo37 ( even after I erased it) and not MyVideo116 ( even is forced under settings) other than tha it seem to be working fine
Reply
Hi,

just two questions: does this also work safely with Lea and second: I can not find any repository ? How do I install it ?

Many thanks !
Reply
Hi mate

I have it on the latest version of Lea and seem to be working fine.

you can download it from HERE , installs as usual
Reply
Thanks !!
Reply
After a hiatus, I again tried database.cleaner v0.5.9 on todays Kodi 18 daily but sadly it seemed to work on the wrong database.

The database.cleaner summary window indicates it is operating on MyVideo113.db but Kodi Leia uses MyVideo116.db as its database so this confuses me no end.
However pushing through and pressing the CLEAN button sees the 1 entry identified as handled while the script also makes a backup of this 113.db due to script settings.
Oddly running the database.cleaner again sees presumably the same 1 entry identified so it seems nothing was cleaned.

OK, so i try to solve the database version issue first by moving all but the Leia database versions out of %appdata%\Kodi\userdata\Database.
Sadly this then cause the following error as seen in the Kodi log (as C.O.D reported here).
Code:
11:19:07.372 T:1110221680 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'sqlite3.OperationalError'>
Error Contents: no such table: path
Traceback (most recent call last):
File "/storage/.kodi/addons/script.database.cleaner/default.py", line 680, in <module>
cleaner_log_file(our_select, False)
File "/storage/.kodi/addons/script.database.cleaner/default.py", line 285, in cleaner_log_file
cursor.execute(our_select)
OperationalError: no such table: path
-->End of Python script error report<--

Oddly, if i set the forced option within database.cleaner advanced tab and specify MyVideo116.db the script fails with a popup indicating Error - forced version of database ( MyVideo116.db ) not found. Script will now exit.

So what should i do to resolve this?
I'm a XBMC novice :)
Reply
(2019-03-09, 06:05)skylarking Wrote: Oddly, if i set the forced option within database.cleaner advanced tab and specify MyVideo116.db the script fails with a popup indicating Error - forced version of database ( MyVideo116.db ) not found. Script will now exit.

So what should i do to resolve this? 

 I had the same problem initially.  Try specifying the database without the extender, i.e. "MyVideo116" and not "MyVideo116.db".
Reply
(2019-03-10, 01:44)Tarkus_ Wrote:
(2019-03-09, 06:05)skylarking Wrote: Oddly, if i set the forced option within database.cleaner advanced tab and specify MyVideo116.db the script fails with a popup indicating Error - forced version of database ( MyVideo116.db ) not found. Script will now exit.

So what should i do to resolve this? 

 I had the same problem initially.  Try specifying the database without the extender, i.e. "MyVideo116" and not "MyVideo116.db".   
 Thanks for the heads up as specifying "MyVideo116" (rather than file name) allowed the database.cleaner summary window to appear and thus pressing the CLEAN button resulted in then script doing its thing. However, for some reason the database.cleaner summary window oddly specifies "MyVideo36" as the database version it is working on even though it is actually working in version 116 and makes a 116 backup?

Also i thought the database.cleaner script would save the log to %appdata%\Kodi\userdata\addon_data\script.databse.clean\ but instead it saves it to %appdata%\Kopdi\cahe\ and that seems just odd.

So my suggestion is that the script needs updating in the following areas:
 - the script should be able to locates the lates database without forcing a version (currently it seems to cap at db version 115 according to Kodi log)
 - the database version shown in the summary window need to be the same as the one the script is working on
 - help text is provided for each script settings option just like kodi core, that way it will be clear what to enter (in my case db name not file name)
 - the script log is saved in a more appropriate place (next to setting.xml seems more logical rather than a cache dir)

If logs are helpful, just ask and i'll aim to obligue (there may be a delay as i'm not on he forum every data).

PS: should add that i think this addon is the great and thanks to @BatterPudding  and @black_eagle for producing it.
I'm a XBMC novice :)
Reply
Hi, I used this on my mysql database (Leia) after specifying the library to clean. It reported that it found a lot of "orphans" to delete and ran without any drama. No problems after running it. Thanks.
Reply
(2019-03-10, 04:55)skylarking Wrote:
(2019-03-10, 01:44)Tarkus_ Wrote:
(2019-03-09, 06:05)skylarking Wrote: Oddly, if i set the forced option within database.cleaner advanced tab and specify MyVideo116.db the script fails with a popup indicating Error - forced version of database ( MyVideo116.db ) not found. Script will now exit.

So what should i do to resolve this? 

 I had the same problem initially.  Try specifying the database without the extender, i.e. "MyVideo116" and not "MyVideo116.db".        
 Thanks for the heads up as specifying "MyVideo116" (rather than file name) allowed the database.cleaner summary window to appear and thus pressing the CLEAN button resulted in then script doing its thing. However, for some reason the database.cleaner summary window oddly specifies "MyVideo36" as the database version it is working on even though it is actually working in version 116 and makes a 116 backup?

Also i thought the database.cleaner script would save the log to %appdata%\Kodi\userdata\addon_data\script.databse.clean\ but instead it saves it to %appdata%\Kopdi\cahe\ and that seems just odd.

So my suggestion is that the script needs updating in the following areas:
 - the script should be able to locates the lates database without forcing a version (currently it seems to cap at db version 115 according to Kodi log)
 - the database version shown in the summary window need to be the same as the one the script is working on
 - help text is provided for each script settings option just like kodi core, that way it will be clear what to enter (in my case db name not file name)
 - the script log is saved in a more appropriate place (next to setting.xml seems more logical rather than a cache dir)

If logs are helpful, just ask and i'll aim to obligue (there may be a delay as i'm not on he forum every data).

PS: should add that i think this addon is the great and thanks to @BatterPudding  and @black_eagle for producing it.     
 Had a quick look at v0.5.9 database.cleaner and its default.py file and came across the following starting at line number 407:
Code:
for num in range(114, 35, -1):
  testname = our_dbname + str(num)
  our_test = db_path + testname + '.db'
this code line explains why the script doesn't find my database version 116 and only shows db version checks starting from 114 down to 36 before defaulting to db version 36 as seen in kodi log.
It also explains why forced database name is just the dbname and not the file name (since .db is appended to db_path + dbname to create the file name to check)

I changed line 407 to the folowing
Code:
for num in range(118, 35, -1):
  testname = our_dbname + str(num)
  our_test = db_path + testname + '.db'
and it worked without having to force any db version within script settings and the correct dbname was shown within the summary window.

Obviously the valid dbname range could depend on whether the constructed sql commands created by the script can cope with future updated kodi db versions but the script seems to now run with Kodi Liea which uses db version 116 (haven't checked in detail that all is done as intended though).

Why the current 0.5.9 version seems to work for some people and didn't work for me without the code change i dont know but maybe something to look at  @black_eagle and update to 0.6.0 ??[/code]
I'm a XBMC novice :)
Reply
(2019-03-10, 11:30)skylarking Wrote: I changed line 407 to the folowing
Code:
for num in range(118, 35, -1):
  testname = our_dbname + str(num)
  our_test = db_path + testname + '.db'

Hi

I tried your "fix" seems to be working fine with 18.1 Leia
Reply
(2019-03-18, 15:17)MAX404 Wrote:
(2019-03-10, 11:30)skylarking Wrote: I changed line 407 to the folowing
Code:
for num in range(118, 35, -1):
  testname = our_dbname + str(num)
  our_test = db_path + testname + '.db'

Hi

I tried your "fix" seems to be working fine with 18.1 Leia  
Glad it runs and seems to work OK.

But do keep in mind that i only took a quick look at the sript to locate the bit of code causing my run problems, so i can't guarantee it wont bork something.

As is, the script seems to have been constucted with specific Database_Versions in mind since it was hardcoded to 114. That seems to imply something later than Krypton but maybe not Leia, maybe. I have not had time to look at how the script actually constructs the sql commands and whether there is indeed any difference based on the database versions. To be able to do such, I'd have to do some study but spare time is a problem atm. To me this seems like a classic dependancy but the addon mechanism seems not to provide a more elegant way to handle such so it's hard coding (which is not ideal).

Still, it now runs and seemed to do a good cleanup.

It didn't seem to cause me any problems other than a netflix related issue. As it was, I'd exported some movies and tv shows via the netflix addon (created .strm files in default location), then i exported the kodi library post scan (saved my metadata locally). I then did a netflix addon updated followed by a database.clean with the result that my netflix exports (.strm files) and the kodi metadata saved to same location had all disapeared Eek Not sure where the fault lies though i suspect it's probably a netflix addon update issue more than a database.cleaner issue but something i'll look into when i have some spare quiet time. So keep that in mind.
I'm a XBMC novice :)
Reply
Your points make total sense as probably as you said it was developed for something later than krypton but not quite Leia...

I had no problem with it that i could notice , I do not use Netflix in kodi so i did not have that issue. Anyhow thanks for the tip and maybe we will have an update on this add on soon
Reply
I think this tool is not compatible with the latest developments of Kodi's archive support (moved to an add-on, but there are two distinct add-ons providing RAR support). It wants to delete all my RAR'd movies, which appear in the log as

Code:
archive://%2fvar%2fmedia%2fwarez%2fMovies%2fRELEASENAMEHERE%2fRELEASENAMEHERE.rar/

They are multipar RAR archives, scene standard. It would be great to have this add-on support archives.
Reply
(2019-04-13, 18:22)nevernow Wrote: I think this tool is not compatible with the latest developments of Kodi's archive support (moved to an add-on, but there are two distinct add-ons providing RAR support). It wants to delete all my RAR'd movies, which appear in the log as

Code:
archive://%2fvar%2fmedia%2fwarez%2fMovies%2fRELEASENAMEHERE%2fRELEASENAMEHERE.rar/

They are multipar RAR archives, scene standard. It would be great to have this add-on support archives.
Archives have nothing to do with anything (or at least, whilst support was in core they didn't - Guess now they are spun out that things may have changed).  However, the addon was originally developed to remove all the crud that is needlessly added to the video database whenever you stream something, be that via netflix, hulu, http(s), rtmp, youtube or whatever.  ALL those videos get added to the database even though they are not in your local library and they all get processed when running a library update with the result that the update is much slower than it ought to be, plus the fact that all that history is retained, possibly for years, through different Kodi versions and library migrations. Imagine the time to migrate those 5000 youtube videos you've watched over the past 3 years, plus all the attempting to look-up art, find a synopsis etc etc

The fact that it can change paths in the db and remove specific paths is because we (batterPudding & I) both thought that that was a useful addition.  It was NEVER designed to fix video databases that hold invalid information because people haven't correctly removed a video source in Kodi (even though it's possible to force the addon to do this) or to remove entries that appear to be valid local sources. It should leave untouched anything that it considers 'valid' - ie, it matches with a valid path in your 'sources.xml' or it has been intentionally excluded from cleaning (see below !!)

If the addon wants to delete your RAR'd stuff, then my first thought would be "Are they in valid directories that are listed in sources.xml?".  If the answer to that is yes, then you can simply create an 'excludes.xml' with contents of

xml:
<excludes>
    <exclude>archive://</exclude>
</excludes>

Please see the 'docs.txt' document for further details, which can be found in the addon's install directory - eg '~/.kodi/addons/script.database.cleaner' for Linux machines, 'Users\[YourUserName]\AppData\Roaming\Kodi\addons\script.database.cleaner' for Win 7/8/10 and 'Users\[YourUserName]\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\addons\script.database.cleaner' for the Win 10 App Store version or you can read the online version here.

There are simply so many scenarios and variations because of the flexibility that Kodi offers, that it's impossible to write something that is capable of a 'catch all' situation.  The best we can manage is to come up with an addon that follows a set of rules that will (should ?) work in the vast majority of cases, and then build in some flexibility to allow the end user to 'tweak' some stuff according to their needs.  It'll never be perfect, it'll probably never meet everyones needs, but whilst Kodi continues to add streaming video to its video.db (whilst not being able to remove it during a 'clean library' run) it's possibly the best solution currently to a problem that really, shouldn't exist.

Latest (Leia compatible) version can be downloaded from here. V0.6.0 is the Leia version (should work with both MySQL and SQlite databases).
Learning Linux the hard way !!
Reply
I apologize if this has been asked before, but I couldn't find anything.

I'm trying to clean up invalid entries that have somehow crept into the 'episode' table - I have rows here for files which have since been deleted, but no combination of this tool nor the traditional clean/update are removing them. Subsequently, my "total/viewed" counts are skewed in the show overview page of Kodi.

Any thoughts on the best method to clean this table out?
Reply
  • 1
  • 22
  • 23
  • 24(current)
  • 25
  • 26
  • 39

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