Release Kodi Selective Cleaner addon support - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151) +---- Thread: Release Kodi Selective Cleaner addon support (/showthread.php?tid=369984) |
RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-30 I've been looking at the performance of the cleaner function and have found the bottleneck. When a record gets cleaned it writes the information to the cleaner logging facility so you can see what is happening and have a log of it. However, I am writing each record and committing each one at a time when doing deletes. Thus it has to open the logging database, write the log record, commit the change and close the logging database on every log write. On my test system this takes .02 - .03 seconds per log entry thus limiting it to around 33-50 records per second (i.e. deletions). This type of logging is fine for general logging items like status messages and such which aren't in bulk like cleaning. I am going to add a second logger to be used only by the cleaner function. It will open the database at the beginning of the clean, write all the records, commit them when done cleaning (or maybe commit after a larger number of writes maybe something like 500 or 1000) and then close the database. This should really speed things up and move any bottleneck back to MySQL. With this approach a progress display may no longer be required. Stay tuned, Jeff RE: Kodi Selective Cleaner addon support - HeresJohnny - 2023-03-31 (2023-03-30, 14:08)Pr.Sinister Wrote: Found a bug when cleaning the files table.Aha! I hadn't noticed it because I'm using the watchedlist add-on. That way, the watched status is never lost since it's synced back and forth between clients and a dedicated database. RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-31 I have uploaded version 0.0.99l of the Kodi Selective Cleaner. This version has the following updates:
*** Warning: Cleaning the file table in strict mode will remove file table entries which don't have movie, episode or music table entries. Please run Analyze Table before cleaning to ensure you want to clean the table. For the cleaning performance I tested with cleaning 1,100 and 10,500 test records on a MySQL test instance for the actor_link table. Here are the before and after results: mysql old 1,100 records 29.72s mysql new 1,100 records .6s mysql new 10,500 records 6.54s This is an improvement of 37 deletions per second to 1,605 deletions per second. Please let me know if you see any issues. Once we agree on normal file cleaning I will post the new code and hopefully it will become the 1.0 production release of the cleaner. Thanks, Jeff RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-31 (2023-03-31, 09:20)HeresJohnny Wrote: Aha! I hadn't noticed it because I'm using the watchedlist add-on. That way, the watched status is never lost since it's synced back and forth between clients and a dedicated database. Actually it does more than remove the watched status. It removes the entire file table entry, which might make the files unplayable depending upon what you are playing them with and whether a file table entry is required. Kodi creates file table entries on on the fly, even for URL based and other similar content. You see it as the bookmark removal impact because the Kodi video database has an SQL trigger called delete_file which removes the bookmark when the underlying file is removed. What we need to agree on is what we want normal file table cleaning to be vs. what I am calling strict mode, which is how it operates today. Thanks, Jeff RE: Kodi Selective Cleaner addon support - HeresJohnny - 2023-03-31 I think some devs should chime in at this point but I don't know who would be the database guy(s). RE: Kodi Selective Cleaner addon support - HeresJohnny - 2023-03-31 I played around with it some more. First, it's very fast now (KSC 0.9i). Second, something is not right. Cleaned episode, season and tv show tables. No mismatches left. Ran database update. Season and tv show mismatches are back. RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-31 (2023-03-31, 21:44)HeresJohnny Wrote: I played around with it some more. First, it's very fast now (KSC 0.9i). What do you mean you ran a database update ? Can you be more specific ? Can you provide the mismatch specifics and are they blue or white ? White is a mismatched data whereas blue are orphaned records. I looked through the analyzer code for those three tables and everything looks right. 0.0.99l didn't change any analyzer query or cleaning code. I am glad to hear you are seeing the performance improvements. Thanks, Jeff RE: Kodi Selective Cleaner addon support - HeresJohnny - 2023-03-31 I ran "Update library". The mismatches are blue. After cleaning they're gone... but returned after "update library"... unfortunately, thousands... I could give you teamviewer access for a look if that helps. RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-31 (2023-03-31, 22:19)HeresJohnny Wrote: I ran "Update library". The mismatches are blue. After cleaning they're gone... but returned after "update library"... unfortunately, thousands... How about if you export the logs out of the addon into CSV format and send them to me ? First clean the tables you want, run the update library and then export the logs and send to me. Run the analyze table again and let me know a few of the records which reappear. Did this happen with prior versions of the cleaner ? This next question is going to sound really dumb but where do I find the Update Library menu item in Kodi ? I don't see that option anywhere. I see update on startup. Is that part of the Library Auto Update addon ? If this doesn't work we can consider a Team Viewer option. Thanks, Jeff RE: Kodi Selective Cleaner addon support - HeresJohnny - 2023-03-31 I'll prepare some exports tomorrow. "Update library" is in the left-hand blade menu under tv shows or movies. RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-03-31 (2023-03-31, 23:03)HeresJohnny Wrote: I'll prepare some exports tomorrow. "Update library" is in the left-hand blade menu under tv shows or movies. Ok. I found the Kodi Update Library feature. It isn't something I've ever used. I tested cleaning the episode table with the copy of your database and version 0.0.99l. I cleaned the table (which removed 35 unmatched records), did an analyze table (there were none), ran Update Library against TV Shows and then ran Analyze Table again. There were still no unmatched records. This might be something where I get a newer snapshot of your database and the steps to recreate the issue. One minor enhancement I see I need to do is write a log message with the cleaning summary. Right now it just provides the popup dialog box and the detail logging of the cleaning but not a cleaning log of the summary (i.e. X records in table Y cleaned).. I'll add that in the next update. Thanks, Jeff RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-04-01 I have uploaded version 0.0.9m of the Kodi Selective Cleaner. This version has the following updates:
Thanks, Jeff RE: Kodi Selective Cleaner addon support - Pr.Sinister - 2023-04-03 (2023-03-31, 09:20)HeresJohnny Wrote:I use the watchedlist addon but it doesn't save the watched status of things not in the library. Only for actual Movies and TV Shows(2023-03-30, 14:08)Pr.Sinister Wrote: Found a bug when cleaning the files table.Aha! I hadn't noticed it because I'm using the watchedlist add-on. That way, the watched status is never lost since it's synced back and forth between clients and a dedicated database. RE: Kodi Selective Cleaner addon support - Pr.Sinister - 2023-04-03 (2023-03-30, 14:29)jbinkley60 Wrote:(2023-03-30, 14:08)Pr.Sinister Wrote: Found a bug when cleaning the files table. Honestly, for the files and path tables, the only way to do it properly is to compare the paths with what is defined in the sources.xml. If they don't exist, then you remove the entry. I see a ton of paths that no longer exist in the path table so it would be nice to clean that. For now, i will just refrain from cleaning the files table so i don't lose my watched states and resume points on my home videos and adult media RE: Kodi Selective Cleaner addon support - jbinkley60 - 2023-04-03 (2023-04-03, 17:58)Pr.Sinister Wrote:(2023-03-30, 14:29)jbinkley60 Wrote:(2023-03-30, 14:08)Pr.Sinister Wrote: Found a bug when cleaning the files table. The new option of not using file table strict checking should take care of things for you. The challenge with Kodi is that is creates a file table entry for anything which gets played, even if an Internet download. There's no easy matching criteria I can find for normal Kodi usage. It is easy with Mezzmo because all files, even trailers, are Mezzmo URLs. I can easily match on them, which is what I do each day with the Kodi database rebuilds. it also takes care of watch statuses and play counters automatically since they are sync'd from Mezzmo. . If you've downloaded the latest version of the cleaner you should notice that it is much faster now. Thanks, Jeff |