Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 39
v19 Video Database Cleaner add-on
Whoops-oops, well, well, a little bit of snarkyness here quite some leading one astray (or just alternative information), I appreciate any kind of your kind information very much, thank you.

No, no, no reason for sorry, now it has become cristal clear, cannot be clearer.

Yes, yes, indeed, but no, no, don't make life too simple without snarkyness.

Many thanks again
Windows 10 Home, 64bit | Newest stable Kodi in portable mode
Reply
I have troubles making the script work.
I'm using Kodi 17.3 on ubuntu and library is on MySQL.

I've tried to clean heavily bloated database but the script did not remove any rows. Than I deleted all bloat rows via sql and run just one video from gag9 for easier testing.

kodi.log
Code:
22:08:15.619 T:139627369970048  NOTICE: CleanDatabase: Starting videodatabase cleanup ..
22:08:19.980 T:139627369970048 WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.bestof9gagtv/?url=L7R3gQHc25A&mode=playVideo
22:08:20.075 T:139627369970048  NOTICE: CleanDatabase: Cleaning videodatabase done. Operation took 00:04

database-cleaner.log
Code:
Video Database Cleaner V1.0.0 - Running at Monday, 17 July 2017 22:08:13

There are 3 paths in the database that meet your criteria

The following paths were removed from the database

special://skin/extras/Intro/
/
plugin://plugin.video.bestof9gagtv/

database-cleaner.old.log
Code:
Video Database Cleaner V1.0.0 - Running at Monday, 17 July 2017 22:08:05

There are 3 paths in the database that meet your criteria

The following file paths would be removed from your database

special://skin/extras/Intro/
/
plugin://plugin.video.bestof9gagtv/

database-cleaner.log claims that database is cleaned, but the corresponding rows in the database are still there.

Can you please help me solve this problem ?
Reply
Please post a full debug log. Snippets out of a log are useless.
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
Found the problem

Code:
11:10:07.918 T:140529035298560   DEBUG: Video Database Cleaner: Got an action 7
11:10:07.919 T:140529035298560   DEBUG: Video Database Cleaner: you pressed clean
11:10:08.001 T:140529035298560   DEBUG: Video Database Cleaner: Writing to new log file
11:10:08.002 T:140529035298560   DEBUG: Video Database Cleaner: database-cleaner.log exists - renaming to old.log
11:10:08.004 T:140529035298560   DEBUG: Video Database Cleaner: Listsize is 5
11:10:08.004 T:140529035298560   DEBUG: Video Database Cleaner: Executing SQL command - DELETE FROM path WHERE idPath IN ( SELECT idPath FROM path WHERE ((strPath NOT LIKE 'pvr://recordings/active/Default/%' AND strPath NOT LIKE 'smb://NUC/Media/HD/%' AND strPath NOT LIKE 'smb://NUC/Media/SD/%' AND strPath NOT LIKE 'smb://NUC/Media/Music Videos/%' AND strPath NOT LIKE 'smb://NUC/Media/Ser/%' AND strPath NOT LIKE 'pvr://%' AND strPath NOT LIKE 'plugin://plugin.video.youtube%' AND strPath NOT LIKE 'plugin://plugin.video.vbox7%' AND strPath NOT LIKE 'plugin://plugin.video.kolibka%' AND idFile NOT IN (SELECT idFile FROM bookmark))));
11:10:08.005 T:140529035298560   DEBUG: Video Database Cleaner: Error in db commit. Transaction rolled back
11:10:08.005 T:140529035298560   DEBUG: Video Database Cleaner: ******************************************************************************
11:10:08.005 T:140529035298560   DEBUG: Video Database Cleaner: **  SQL ERROR  **  SQL ERROR   **  SQL ERROR  **  SQL ERROR  **  SQL ERROR  **
11:10:08.005 T:140529035298560   DEBUG: Video Database Cleaner: **   1054 (42S22): Unknown column 'idFile' in 'IN/ALL/ANY subquery'
11:10:08.005 T:140529035298560   DEBUG: Video Database Cleaner: ******************************************************************************
11:10:08.006 T:140529035298560   DEBUG: Video Database Cleaner: Database connection closed
11:10:08.043 T:140530132601216   DEBUG: ------ Window Init (DialogNotification.xml) ------
11:10:08.252 T:140530132601216   DEBUG: ------ Window Deinit (/home/grubia/.kodi/addons/script.database.cleaner/resources/skins/Default/720p/script.database.cleaner-summary.xml) ------
11:10:10.005 T:140529035298560   DEBUG: JSONRPC: Incoming request: { "jsonrpc": "2.0", "method": "VideoLibrary.Clean","id": 1 }

SQL statement is not correct. There is no idFile column in path table. It is in table files.

Problem only exists when "Keep any bookmarked files" is enabled in settings. Problem is in default.py here:
Code:
if bookmarks:  # have to delete from paths table rather than files as there is a conflicting trigger on the files table
        our_select = sql.replace('DELETE FROM files', 'SELECT strPath FROM path WHERE idPath in (SELECT idPath FROM files', 1)
        our_select = our_select.replace('bookmark)', 'bookmark))',1)
        sql = sql.replace('DELETE FROM files','DELETE FROM path',1)
Reply
When I try to run this add-on it won't start and I get the following error. Running OS X 10.11.6 Kodi 17.3:

Quote:ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'xml.etree.ElementTree.ParseError'>
Error Contents: not well-formed (invalid token): line 4, column 4
Traceback (most recent call last):
File "/Users/matt/Library/Application Support/Kodi/addons/script.database.cleaner/default.py", line 417, in <module>
advancedsettings = ET.parse(advanced_file)
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/xml/etree/ElementTree.py", line 656, in parse
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/xml/etree/ElementTree.py", line 1653, in feed
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/xml/etree/ElementTree.py", line 1517, in _raiseerror
ParseError: not well-formed (invalid token): line 4, column 4
-->End of Python script error report<--

edit: fixed it. I had commented a line out in my advancedsetting.xml file with a "!". Apparently your add-on didn't like that.
Reply
(2017-07-19, 18:47)desepticon Wrote: edit: fixed it. I had commented a line out in my advancedsetting.xml file with a "!". Apparently your add-on didn't like that.

To clarify, you had to remove commented out lines from your advancedsettings.xml ?
Kodi 17.6 on multiple Windows 10 x64 machines with shared MySQL 5.6.43 database. Kodi 18 on Xbox One. Content (music, video, photos) stored on Windows Server 2012 R2 file server and accessed by SMB.
Reply
(2017-07-21, 04:09)AnthonyB Wrote:
(2017-07-19, 18:47)desepticon Wrote: edit: fixed it. I had commented a line out in my advancedsetting.xml file with a "!". Apparently your add-on didn't like that.

To clarify, you had to remove commented out lines from your advancedsettings.xml ?

Well I'll be damned, that was it.

I also removed all commented lines from my advancedsettings.xml, i.e. all the lines that started with < ! - - (double-spaced so the forums don't interpret and convert) and the plugin worked again.
Kodi 17.6 on multiple Windows 10 x64 machines with shared MySQL 5.6.43 database. Kodi 18 on Xbox One. Content (music, video, photos) stored on Windows Server 2012 R2 file server and accessed by SMB.
Reply
(2017-07-21, 04:09)AnthonyB Wrote:
(2017-07-19, 18:47)desepticon Wrote: edit: fixed it. I had commented a line out in my advancedsetting.xml file with a "!". Apparently your add-on didn't like that.

To clarify, you had to remove commented out lines from your advancedsettings.xml ?

Yup. That was the issue.
Reply
I'm running v17.4 in portable mode. Where does the database-cleaner.log file get created. I've done all local drive search and nothing.

I'm getting "check the log for more information" but cannot find the log.

But before I get that it doesn't run ( I suppose that's why no log is created)

Heres the Kodi.log.

I'm tried removing the comment blocks in the userdata\advancedsettings.xml file but no luck.

kodi.log https://pastebin.com/K3ZJknHS
Reply
FIXED with help of the 3 comments above. I should of really stopped and read them carefully.

I've been able to keep my comments in the advancedsettings.xml file. It depends on how they're formatted..

Like this:
Code:
<!-- <loglevel hide="true">0</loglevel> -->

As opposed to:
Code:
<!-- <subsdelayrange>240</subsdelayrange> <!-- Comment: Subtitle offset adjustment range -->

Where that has two opening comment blocks and only one closing. At least I think that's what was causing bad parsing of the advancedsettings.xml file by the plug.

Here's my new advancedsettings.xml file in full.

5minutes cleaning down to 3-5 seconds. Thank you.

Code:
<advancedsettings>
    <loglevel>0</loglevel>
    <!-- Comment: Disables logging -->
    <!-- <loglevel hide="true">0</loglevel> -->
    <playcountminimumpercent>95</playcountminimumpercent>
    <video>
        <cleanstrings>
            <regexp>\s\([^\d]+?\)|[^\)]+?$|-|\s{2}</regexp>
        </cleanstrings>
        <!-- Comment: Skip back time 15 s -->
        <timeseekforward>30</timeseekforward>
        <!-- Comment: Skip forward time 15 s -->
        <timeseekbackward>-30</timeseekbackward>
        <!-- Comment: Subtitle offset adjustment range -->
        <!-- <subsdelayrange>240</subsdelayrange> -->
    </video>
    <videolibrary>
        <!-- Comment: Also clean library during library update -->
        <cleanonupdate>false</cleanonupdate>
        <importwatchedstate>true</importwatchedstate>
        <!-- removes the "*All" items from the video library -->
        <!-- <hideallitems>true</hideallitems> -->
        <!-- hide empty series in the video library -->
        <hideemptyseries>true</hideemptyseries>
        <!-- number of recently added items. Defaults to 25 -->
        <recentlyaddeditems>20</recentlyaddeditems>
    </videolibrary>
    <videoscanner>
        <!-- Set to true to silently ignore errors while scanning videos. This prevents the er$ -->
        <ignoreerrors>false</ignoreerrors>
    </videoscanner>
</advancedsettings>
<!--
HELP:
Commands:
Addons                ActivateWindow(videos,addons,return)
Playlists            ActivateWindow(videos,playlists,return)
Video Files            ActivateWindow(10025,sources://video)
Main Library        ActivateWindow(videos,root)
-->
Reply
(2017-09-13, 10:39)stephen147 Wrote: FIXED with help of the 3 comments above. I should of really stopped and read them carefully.

I've been able to keep my comments in the advancedsettings.xml file. It depends on how they're formatted..

Like this:
Code:
<!-- <loglevel hide="true">0</loglevel> -->

As opposed to:
Code:
<!-- <subsdelayrange>240</subsdelayrange> <!-- Comment: Subtitle offset adjustment range -->

You might consider installing something like notepad++ text editor. There are xml addons for it that will highlight and catch syntax errors in xml as well as other formats (for xml also, there's a "pretty print" option that will format your xml with end of line and tab spacing to make it much more readable).

scott s.
.
Reply
(2017-09-13, 20:57)scott967 Wrote: You might consider installing something like notepad++ text editor. There are xml addons for it that will highlight and catch syntax errors in xml as well as other formats (for xml also, there's a "pretty print" option that will format your xml with end of line and tab spacing to make it much more readable).
scott s.
That just happened when I blocked out the line with the end part already blocked out. Blocking the code on their own respective lines is how I would do comments now.

Stopped with NP++ ages ago. Sublime text 3 is thee best text editor I've ever used. Smile
All you have to do is save in Sublime and it reindents the code for you and trims trailing spaces. I use it for mostly writing mxs code for 3ds Max. Uber powerful lightweight text editor.
Reply
(2017-09-13, 21:28)stephen147 Wrote: Stopped with NP++ ages ago. Sublime text 3 is thee best text editor I've ever used. Smile
All you have to do is save in Sublime and it reindents the code for you and trims trailing spaces. I use it for mostly writing mxs code for 3ds Max. Uber powerful lightweight text editor.

Agree Sublime is good, but at $80 a license, a little expensive.

scott s.
.
Reply
I know this is going off-topic but it's completely free. You only get a popup every 20 odd saves in the eval app. Other than that it's the full version.

I will eventually buy it when I get paid work for my maxscripts.

Quote from website. https://www.sublimetext.com/3
Quote:Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use. There is currently no enforced time limit for the evaluation.
Reply
Is that a change? I installed it a ways back to check it out and all it does now is launch an "enter license" pop-up.

scott s.
.
Reply
  • 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 39

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