[RELEASE] Texture Cache Maintenance utility
(2016-02-05, 02:05)Milhouse Wrote: Tvshows don't have imdbnumbers, and I don't think the media library database supports multiple paths for the same tvshow/season/episode so I'm not sure how it would be possible to accurately determine that some random file path is a duplicate of an episode. If you've got any ideas let me know.

i sorted this out in bash by concatenating 'showID-season#-ep#' to form a uniqueID

the first query makes a list of any uniqueIDs with more then 1 entry. (find the dups)
then we loop though the LIST and query again for the path/file.name of each offender

hope this gets the creative juice flowing ...

Code:
#!/bin/bash
# xbmc.tv.duplicate ep detector
mysqlCMD="mysql --skip-column-names -u<USERNAME> -p<PASSWORD> <DB> -e"

LIST="$($mysqlCMD "SELECT CONCAT( idShow,  \"-\", c12,  \"-\", c13 ) AS id,
    COUNT( * ) AS num
    FROM episode_view
    GROUP BY id
    HAVING num >1" | cut -f1 | sort -n)"

for x in $LIST ; do
    $mysqlCMD "SELECT c18 from episode_view
            where CONCAT (idShow,  \"-\", c12,  \"-\", c13 ) = \"$x\" "
done

BTW, thank you for this awesome sauce !!
in the last 8yrs i've amassed 7.8gb of thumbnail cache
... now 5.2 after a "quick" prune
rPi 2&3 | android phones | fireHD8 | linux | win10 + NFS NAS w/ mySQL + props to...
libreElecyatse, titan, AELflexGet, context.manageTags (a zosky original)
Reply


Messages In This Thread
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
RE: [RELEASE] Texture Cache Maintenance utility - by zosky - 2016-02-13, 07:48
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17