From 6087d31812bc7fc5d651be830c8e206294ea1596 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 9 Feb 2020 00:32:53 +0000 Subject: [PATCH] command to wipe thumb cache --- ext/rule34/main.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/rule34/main.php b/ext/rule34/main.php index 64943ddd..848c577f 100644 --- a/ext/rule34/main.php +++ b/ext/rule34/main.php @@ -64,6 +64,13 @@ class Rule34 extends Extension public function onCommand(CommandEvent $event) { + global $cache; + if ($event->cmd == "wipe-thumb-cache") { + foreach (Image::find_images_iterable(0, null, Tag::explode($event->args[0])) as $image) { + print($image->id . "\n"); + $cache->delete("thumb-block:{$image->id}"); + } + } } public function onSourceSet(SourceSetEvent $event)