[danbooru api] ignore star searches

This commit is contained in:
Shish
2023-07-03 11:28:10 +01:00
committed by Shish
parent 3c18ebd40c
commit f7f0c11ee8
2 changed files with 5 additions and 0 deletions

View File

@@ -195,6 +195,10 @@ class DanbooruApi extends Extension
}
$tags = isset($_GET['tags']) ? Tag::explode($_GET['tags']) : [];
// danbooru API clients often set tags=*
$tags = array_filter($tags, static function ($element) {
return $element !== "*";
});
$count = Image::count_images($tags);
$results = Image::find_images(max($start, 0), min($limit, 100), $tags);
}