Giter Site home page Giter Site logo

plugin.program.kscleaner's Introduction

Kodi Selective Cleaner addon

A program addon to allow selective deletion of data in the Kodi Video and Music databases

Kodi Support Forum
Wiki page

Features:

  • Kodi 19, 20 and 21 compatible.
  • Support for both Kodi Local and MySQL databases
  • Individually select data in the Kodi video and music databases
  • Database analyzer to find and delete orphaned or mismatched data
  • Duplicate Video Media Analysis to find duplicate files and video content
  • Logging database to track all activities with Log Viewer
  • CSV export for Video, Music and Textures databases
  • Selective Video, Music and Textures database backups

plugin.program.kscleaner's People

Contributors

jbinkley60 avatar

Stargazers

 avatar Predrag Đokić avatar Lyden avatar  avatar  avatar Lunatixz avatar  avatar  avatar  avatar

Watchers

Nanomani avatar  avatar  avatar

plugin.program.kscleaner's Issues

REQ: Look for Radarr incompatible format

In Kodi v18, they changed the default naming conventions for images from

'poster.jpg' and 'fanart.jpg'

to

'-poster.jpg' and '-fanart.jpg'

Radarr has not updated its system to align with this change. It still stores downloaded imagery in the old format. As such, Kodi does not import these images and resorts to downloading them again.

It would be a great feature if the add-on were able to identify these situations and correct them, at least until Radarr is updated to correct the problem. But since this has been outstanding since 2020. It doesn't look like it's going to be fixed soon.

Radarr/Radarr#5050

Suggestion: Readme should include instructions for installation and use

Would be nice if the Readme explained a little more, e.g.,

Installation

Kodi Selective Cleaner is not in the Kodi repository, because Team Kodi doesn't allow add-ons which do direct database calls, which are required for this to operate.

To install, you need to download the ZIP file directly from this repository (i.e., select Code > Download ZIP), place the downloaded file into a source directory for your Kodi installation, and then use Add-ons > Install from zip file in the Kodi Add-ons manager.

Usage

...


Rationale for this suggestion: https://blog.codinghorror.com/if-it-isnt-documented-it-doesnt-exist/

Database access error due to ampersand in password

I am wondering why using ET.parse(config_file) was not sufficient for parsing the configuration file here:

#tree = ET.parse(config_file)
with open(file=config_file, mode='r', encoding='utf-8-sig') as xml_txt:
tree = ET.fromstring((xml_txt.read().replace('&',' ').strip().encode('utf-8')), ET.XMLParser(encoding='utf-8'))

The replacing code broke the add-on in my case as my password contains an ampersand (which was replaced by a white-space).
Uncommenting line 94 (and commenting out the following two lines) fixed it for me.

EDIT: this is using the LibreElec 12 Beta with Kodi 21, Python 3.11.8

script failing

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.