Switched back to previous random method for Danbooru.

This commit is contained in:
flash 2023-11-06 14:26:23 +00:00
parent f491be9eba
commit e8edf8b5f3

View file

@ -20,13 +20,14 @@ class DanbooruSource implements IBooruSource {
} }
public function getPosts(string $tags, bool $random = true, int $limit = 20): array { public function getPosts(string $tags, bool $random = true, int $limit = 20): array {
if($random)
$tags .= ' order:random';
$params = []; $params = [];
if($tags !== '') if($tags !== '')
$params['tags'] = $tags; $params['tags'] = $tags;
if($limit > 0) if($limit > 0)
$params['limit'] = $limit; $params['limit'] = $limit;
if($random)
$params['random'] = '1';
$url = self::POSTS_URL; $url = self::POSTS_URL;
if(!empty($params)) if(!empty($params))