Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 34
  • 35
  • 36(current)
  • 37
  • 38
  • 39
v19 Video Database Cleaner add-on
So, where are the install instructions for those of us that don't know what we're doing? Install fails with "ERROR <general>: CAddonInstallJob[script.database.cleaner]: The dependency on xbmc.python version 2.1.0 could not be satisfied." which sounds to me like it requires that version of python, which is 20 years old? Is that right?
Reply
(2021-07-20, 05:53)DGenerateKane Wrote: So, where are the install instructions for those of us that don't know what we're doing? Install fails with "ERROR <general>: CAddonInstallJob[script.database.cleaner]: The dependency on xbmc.python version 2.1.0 could not be satisfied." which sounds to me like it requires that version of python, which is 20 years old? Is that right?

for Kodi 19 Matrix and python 3 all is here Smile 

GIT : https://github.com/klyco/script.database.cleaner

ZIP : https://github.com/klyco/script.database...master.zip
Reply
There seems to be an issue with the code that builds sql statements used when the "Remove a specific path from the database" option is used or the "Deep Clean" is used with a path specified.

The debug log following the execution of either operation contains lines similar to the following:
Quote:2021-07-24 16:49:22.122 T:8508    DEBUG <general>: Video Database Cleaner: Executing SQL command - SELECT strPath FROM path WHERE strPath LIKE %s - params: ['test%']
2021-07-24 16:49:22.127 T:8508    DEBUG <general>: Video Database Cleaner: Executing SQL command - SELECT count(*) FROM files WHERE NOT EXISTS (SELECT 1 FROM path WHERE path.idPath = files.idPath) OR idPath IN (SELECT DISTINCT idPath FROM path WHERE strPath LIKE %)s - params: ['test%']
2021-07-24 16:49:22.127 T:8508    DEBUG <general>: Video Database Cleaner: Error executing SQL statement. The SQL statement was: SELECT count(*) FROM files WHERE NOT EXISTS (SELECT 1 FROM path WHERE path.idPath = files.idPath) OR idPath IN (SELECT DISTINCT idPath FROM path WHERE strPath LIKE %)s, called with parameters ['test%']. Error: Not all parameters were used in the SQL statement

It looks like the string placeholder has somehow gotten a closing bracket inserted between the % and s.

I did start to look through the script code in effort to put in a pull request to fix it, but am unfortunately not familiar with python or with the codebase, so simply wouldn't have the time to learn both at the moment.
Reply
VDC query:
SELECT count(*) FROM files WHERE NOT EXISTS (SELECT 1 FROM path WHERE path.idPath = files.idPath) OR idPath IN (SELECT DISTINCT idPath FROM path WHERE strPath LIKE %)s

In Workbench MySQL:
18:30:40 SELECT count(*) FROM files WHERE NOT EXISTS (SELECT 1 FROM path WHERE path.idPath = files.idPath) OR idPath IN (SELECT DISTINCT idPath FROM path WHERE strPath LIKE %)s Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%)s' at line 1 0,0033 sec

LIKE is typically used for text strings, so the parameter should be enclosed in quotes or double quotes. No idea what the ) character is for.
Reply
(2021-07-20, 06:56)Nanomani Wrote:
(2021-07-20, 05:53)DGenerateKane Wrote:  
for Kodi 19 Matrix and python 3 all is here Smile 
ZIP : https://github.com/klyco/script.database...master.zip

Thanks!  I was having issues after changing to a new router, and updating to the latest version of this addon fixed it.  Thank you!
Reply
(2021-07-24, 18:33)Klojum Wrote: LIKE is typically used for text strings, so the parameter should be enclosed in quotes or double quotes. No idea what the ) character is for.
Its the terminator for the in statement.
Should read:
(SELECT DISTINCT idPath FROM path WHERE strPath LIKE %s)
Reply
@kenmills In that case, the query is wrong. ^^
Reply
I've found some time to investigate this today. Just looking for keywords around the sql statements that were logged meant that I only had to learn enough to understand what a few lines of the pyton code is doing instead of the whole lot.

Anyway, the issue can be fixed by updating line 183, which is currently:
python:
count_files_statement = count_files_statement[:-1] + '))' + count_files_statement[-1:]
to be:
python:
count_files_statement = count_files_statement + ')'

I also found that there's a similar SQL syntax issue when attempting to replace a path in the database, which can be fixed by updating line 1154, currently:
python:
sql = sql.replace('((strPath', '(strPath').replace(' AND ())', ')')
to be:
python:
sql = sql.replace('((strPath', '(strPath').replace(' AND ())', '')

I did attempt to raise pull requests for theses updates, but I don't seem to have access to push to the repo:
git:
$ git push origin no_sources_disabled_sql_fix
remote: Permission to klyco/script.database.cleaner.git denied to sim099.
fatal: unable to access 'https://github.com/klyco/script.database.cleaner.git/': The requested URL returned error: 403
Reply
(2021-08-22, 14:38)sim099 Wrote: I did attempt to raise pull requests for theses updates, but I don't seem to have access to push to the repo:

Assuming you forked klyco/script.database.cleaner then push your updates to a new branch of your fork and then create a PR from that back to the original.
Learning Linux the hard way !!
Reply
(2021-08-22, 16:19)black_eagle Wrote:
(2021-08-22, 14:38)sim099 Wrote: I did attempt to raise pull requests for theses updates, but I don't seem to have access to push to the repo:

Assuming you forked klyco/script.database.cleaner then push your updates to a new branch of your fork and then create a PR from that back to the original.

I was attempting to push to the repo that I cloned from, but now you mention it that's unlikely to work.

It may be for the best to be honest. Those updates worked in the specific cases I mentioned, but when I tried to use it without either of those features enabled it failed with an SQL syntax error.
Reply
Hope you all are still active. This might be a ELI5 as I am more of a hardware tech nerd than software but  I have about 900 movies, id say 30% of them have duplicated, or I have deleted, or for whatever reason they are off my 2 external HDDs. I used the vanilla library clean, nothing happened. I have installed this add on 6.1 (i think?) I hit clean and it just opened up the vanilla library cleaner again and after about 20+ minutes nothing happened. I imagine I am doing something wrong on my end. I would love some help.
Reply
(2021-09-20, 22:32)fstr21 Wrote: I have about 900 movies, id say 30% of them have duplicated, or I have deleted, or for whatever reason they are off my 2 external HDDs

With duplicates it's hard to identify which is the correct entry.

What type of duplicates do you have?
- Extension only
- Different filename
- Both of the above
Reply
(2021-09-20, 23:01)Klojum Wrote:
(2021-09-20, 22:32)fstr21 Wrote: I have about 900 movies, id say 30% of them have duplicated, or I have deleted, or for whatever reason they are off my 2 external HDDs

With duplicates it's hard to identify which is the correct entry.

What type of duplicates do you have?
- Extension only
- Different filename
- Both of the above

The dupes don't concern me because if I can clean the entire library of movies that aren't connected to a source any more then it'll fix that problem as well. That's what I'm looking to do in the end. Basically I just want every movie that isn't on a source gone. Hell I can taken out all sources, it's just 2 hdd and delete the entire list and repopulate it if that's easier. Just can't figure out how to get rid of the initial list
Reply
(2021-09-20, 22:32)fstr21 Wrote: I used the vanilla library clean, nothing happened. I have installed this add on 6.1 (i think?) I hit clean and it just opened up the vanilla library cleaner again and after about 20+ minutes nothing happened.
 
Kodi's "Clean Library" option (under the settings) should do exactly what you're describing.

For example, adding "Movie/Movie.mkv" and then renaming it to "Movie (2021)/Movie (2021).mkv" and re-scanning would result in the movie being displayed twice. Deleting "Movie (2021)/Movie (2021).mkv" would obviously result in neither of those entries being useable because the filles they point to don't exist.

The "Clean Library" function checks all entries in the database to make sure that the referenced file is still available, removing that entry from the database if not. That's how it works as far as I understand it from my usage anyway, I haven't confirned that in the code.

(2021-09-21, 00:57)fstr21 Wrote: The dupes don't concern me because if I can clean the entire library of movies that aren't connected to a source any more then it'll fix that problem as well. That's what I'm looking to do in the end. Basically I just want every movie that isn't on a source gone. Hell I can taken out all sources, it's just 2 hdd and delete the entire list and repopulate it if that's easier. Just can't figure out how to get rid of the initial list

Weren't you asking how to get rid of the duplicates? Huh Laugh "Clean Library" should do that as long as the duplicates don't remain on the source(s) (i.e. you've deleted "Movie/Movie.mkv" in the example above meaning that Kodi no longer finds it).

If you just want to remove everything from your library then I'm pretty sure that if you begin to remove a source, you'll be asked if you want to remove everything under that source from the database.
Reply
(2021-09-21, 14:57)sim099 Wrote:
(2021-09-20, 22:32)fstr21 Wrote: I used the vanilla library clean, nothing happened. I have installed this add on 6.1 (i think?) I hit clean and it just opened up the vanilla library cleaner again and after about 20+ minutes nothing happened.
 
Kodi's "Clean Library" option (under the settings) should do exactly what you're describing.

For example, adding "Movie/Movie.mkv" and then renaming it to "Movie (2021)/Movie (2021).mkv" and re-scanning would result in the movie being displayed twice. Deleting "Movie (2021)/Movie (2021).mkv" would obviously result in neither of those entries being useable because the filles they point to don't exist.

The "Clean Library" function checks all entries in the database to make sure that the referenced file is still available, removing that entry from the database if not. That's how it works as far as I understand it from my usage anyway, I haven't confirned that in the code.

(2021-09-21, 00:57)fstr21 Wrote: The dupes don't concern me because if I can clean the entire library of movies that aren't connected to a source any more then it'll fix that problem as well. That's what I'm looking to do in the end. Basically I just want every movie that isn't on a source gone. Hell I can taken out all sources, it's just 2 hdd and delete the entire list and repopulate it if that's easier. Just can't figure out how to get rid of the initial list

Weren't you asking how to get rid of the duplicates? Huh Laugh "Clean Library" should do that as long as the duplicates don't remain on the source(s) (i.e. you've deleted "Movie/Movie.mkv" in the example above meaning that Kodi no longer finds it).

If you just want to remove everything from your library then I'm pretty sure that if you begin to remove a source, you'll be asked if you want to remove everything under that source from the database.

I'm still at work. But I think I might have a possible idea what's going on... By "removing a source" I assumed you meant disconnecting the actual hardware. That's what I was doing unplugging my hdd then running the cleaner. Now I'm thinking there is a software option to remove the source ... Assuming the source is connected ..somewhere in that menu?
Reply
  • 1
  • 34
  • 35
  • 36(current)
  • 37
  • 38
  • 39

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