summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-05-15 14:03:10 +0200
committerYorhel <git@yorhel.nl>2020-05-15 14:03:10 +0200
commit9e95731e605cc043908652712d69b2666fa4de04 (patch)
tree14768f4851bd5d3c632267b0c11c632031a55b15
parentc3318cb2cc5104d3c7f403b8ad6c70b6fa00b55e (diff)
unusedimages.pl: Fix silly SQL bug
-rwxr-xr-xutil/unusedimages.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/unusedimages.pl b/util/unusedimages.pl
index 818a82d2..55797c97 100755
--- a/util/unusedimages.pl
+++ b/util/unusedimages.pl
@@ -32,10 +32,11 @@ sub cleandb {
# referenced from somewhere, soon.
my $cnt = $db->do(q{
DELETE FROM images WHERE id IN(
- SELECT id FROM images EXCEPT
+ SELECT id FROM images
WHERE id NOT IN(SELECT id FROM images WHERE id BETWEEN vndbid('ch',1) AND vndbid_max('ch') ORDER BY id DESC LIMIT 30)
AND id NOT IN(SELECT id FROM images WHERE id BETWEEN vndbid('cv',1) AND vndbid_max('cv') ORDER BY id DESC LIMIT 30)
AND id NOT IN(SELECT id FROM images WHERE id BETWEEN vndbid('sf',1) AND vndbid_max('sf') ORDER BY id DESC LIMIT 100)
+ EXCEPT
SELECT * FROM (
SELECT scr FROM vn_screenshots
UNION SELECT scr FROM vn_screenshots_hist