diff --git a/TODO b/TODO index 64fc778a..c1049558 100644 --- a/TODO +++ b/TODO @@ -27,7 +27,6 @@ everything related to posts: - search order - order:id - order:time - - order:score - order:comment_count - order:comment_time - order:file_size diff --git a/src/SearchServices/Filters/PostFilter.php b/src/SearchServices/Filters/PostFilter.php index c610cac7..bad1dd16 100644 --- a/src/SearchServices/Filters/PostFilter.php +++ b/src/SearchServices/Filters/PostFilter.php @@ -6,6 +6,7 @@ class PostFilter extends BasicFilter implements IFilter const ORDER_FAV_TIME = 'lastFavTime'; const ORDER_FAV_COUNT = 'favCount'; const ORDER_TAG_COUNT = 'tagCount'; + const ORDER_SCORE = 'score'; const REQUIREMENT_TAG = 'tag'; const REQUIREMENT_ID = 'id'; diff --git a/src/SearchServices/Parsers/PostSearchParser.php b/src/SearchServices/Parsers/PostSearchParser.php index a19a3cd9..d47bb325 100644 --- a/src/SearchServices/Parsers/PostSearchParser.php +++ b/src/SearchServices/Parsers/PostSearchParser.php @@ -43,6 +43,9 @@ class PostSearchParser extends AbstractSearchParser elseif ($token === 'tag_count') return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_TAG_COUNT; + elseif ($token === 'score') + return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_SCORE; + throw new \BadMethodCallException('Not supported'); }