diff options
author | Yorhel <git@yorhel.nl> | 2020-05-15 14:03:10 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-05-15 14:03:10 +0200 |
commit | 9e95731e605cc043908652712d69b2666fa4de04 (patch) | |
tree | 14768f4851bd5d3c632267b0c11c632031a55b15 | |
parent | c3318cb2cc5104d3c7f403b8ad6c70b6fa00b55e (diff) |
unusedimages.pl: Fix silly SQL bug
-rwxr-xr-x | util/unusedimages.pl | 3 |
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 |