2016-04-17, 13:34
(2016-04-16, 20:28)zerocool_ie Wrote:This makes sense from looking at the contents of my database. I am doing some manual interrogation of my database as I am trying to make some fool proof rules. I can see that many of my correctly scraped folders have NULL in strContent. No real pattern though. I guess it could be from which version of KODI originally scraped the TV show into the database for me. Similar with the "dateAdded" field. Sometimes it has a value and sometimes not.(2016-04-16, 19:41)jeffski10 Wrote: SELECT * FROM `path` as t1 left join files as t2 on t1.idpath = t2.idpath where t2.idpath is null and t1.strContent is null
delete t1 FROM `path` as t1 left join files as t2 on t1.idpath = t2.idpath where t2.idpath is null and t1.strContent is null
Interestingly, updating my library after running this query caused Kodi to recreate a row for every 1st sub-folder of my TV sources...
Code:smb://SERVER/TV/TV-Continuing/Show 1
smb://SERVER/TV/TV-Continuing/Show 2
smb://SERVER/TV/TV-Ended/Show 1
smb://SERVER/TV/TV-Ended/Show 2
Haven't seen any negative effects yet.
Edit: Looks like the artwork for all of my TV shows and casts is rebuilding...
If I run the SQL command on the paths as suggested
SELECT * FROM `path` as t1 left join files as t2 on t1.idpath = t2.idpath where t2.idpath is null and t1.strContent is null
It would delete 80 totally legitimate parent folders. For example a show scanned in like this:
smb://SERVER/!TV/Lilyhammer/
smb://SERVER/!TV/Lilyhammer/Series 01/
smb://SERVER/!TV/Lilyhammer/Series 02/
Will have the parent folder deleted by the above SQL. NOT a pretty thing to happen in the database as there are lots of parent pointers that this would then break. A path can only really be deleted if it has no siblings.