jbinkley60 / plugin.program.kscleaner

GNU General Public License v2.0
10 stars 2 forks source link

script failing #2

Closed rantanlan closed 1 year ago

rantanlan commented 1 year ago

Hey,

just gave your script a try and it is failing...

with the default settings it won't find my mariadb, "missing myvideos119" I have no explicit naming in the advancedsettings.xml If I'll override it in the plugin settings with "MyVideos119" and "MyMusic82" it connects but throw the following error.

Currently running 19.5 on windows and linux with a shared mariadb... not sure why is it searching for an album table in the video section... (I currently have an empty music library)

2023-05-25 10:29:42.809 T:19352   DEBUG <general>: Kodi selective cleaner movie count: xxx
2023-05-25 10:29:42.825 T:19352   DEBUG <general>: Kodi selective cleaner TV show count: xxx
2023-05-25 10:29:42.885 T:19352   ERROR <general>: KS Cleaner main menu error. 
2023-05-25 10:29:42.891 T:19352   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'UnboundLocalError'>
                                                   Error Contents: local variable 'curpf' referenced before assignment
                                                   Traceback (most recent call last):
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\plugin.program.kscleaner\resources\lib\menu.py", line 84, in displayMenu
                                                       kmcursor.execute(mmquery)
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\script.module.myconnpy\lib\mysql\connector\cursor.py", line 569, in execute
                                                       self._handle_result(self._connection.cmd_query(stmt))
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\script.module.myconnpy\lib\mysql\connector\connection.py", line 590, in cmd_query
                                                       result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\script.module.myconnpy\lib\mysql\connector\connection.py", line 478, in _handle_result
                                                       raise errors.get_exception(packet)
                                                   mysql.connector.errors.ProgrammingError: 1146 (42S02): Table 'MyVideos119.album' doesn't exist

                                                   During handling of the above exception, another exception occurred:

                                                   Traceback (most recent call last):
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\plugin.program.kscleaner\default.py", line 2, in <module>
                                                       from resources.lib import menu
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\plugin.program.kscleaner\resources\lib\menu.py", line 180, in <module>
                                                       displayMenu()                                                   #  Display main menu
                                                     File "C:\Users\mason\AppData\Roaming\Kodi\addons\plugin.program.kscleaner\resources\lib\menu.py", line 114, in displayMenu
                                                       del curpf
                                                   UnboundLocalError: local variable 'curpf' referenced before assignment
                                                   -->End of Python script error report<--

2023-05-25 10:29:42.891 T:19352   DEBUG <general>: CPythonInvoker::onExecutionDone(5, C:\Users\mason\AppData\Roaming\Kodi\addons\plugin.program.kscleaner\default.py)
jbinkley60 commented 1 year ago

The only reason I can see that this would happen is something in the configuration that is pointing the music MySQL connection to your video database. I need to see a section of the debug log which shows the connection strings when the addon starts. It prints the connection strings to the debug log.

The debug lines will start with:

KS Cleaner parse:

followed by the connection type, host name, port number and type information. I am mainly interested in the connection type, hostname and port.

jbinkley60 commented 1 year ago

I dug around more in the code and I believe I found the issue with user defined names in the music database section. Can you try this test release with the fix ?

rantanlan commented 1 year ago

script starts up fine now! thanks :)

jbinkley60 commented 1 year ago

Great. Thanks for reporting the issue.