[danbooru api] ignore star searches
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ class DanbooruApiTest extends ShimmiePHPUnitTestCase
|
||||
$this->get_page("api/danbooru/find_posts");
|
||||
$this->get_page("api/danbooru/find_posts", ["id"=>$image_id]);
|
||||
$this->get_page("api/danbooru/find_posts", ["md5"=>"17fc89f372ed3636e28bd25cc7f3bac1"]);
|
||||
$this->get_page("api/danbooru/find_posts", ["tags"=>"*"]);
|
||||
|
||||
$this->get_page("api/danbooru/find_tags");
|
||||
$this->get_page("api/danbooru/find_tags", ["id"=>1]);
|
||||
|
Reference in New Issue
Block a user