2016-02-13, 07:48
(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