Added order:score support to post searching
This commit is contained in:
parent
e0ced89a9b
commit
736a25c3a4
3 changed files with 4 additions and 1 deletions
1
TODO
1
TODO
|
@ -27,7 +27,6 @@ everything related to posts:
|
||||||
- search order
|
- search order
|
||||||
- order:id
|
- order:id
|
||||||
- order:time
|
- order:time
|
||||||
- order:score
|
|
||||||
- order:comment_count
|
- order:comment_count
|
||||||
- order:comment_time
|
- order:comment_time
|
||||||
- order:file_size
|
- order:file_size
|
||||||
|
|
|
@ -6,6 +6,7 @@ class PostFilter extends BasicFilter implements IFilter
|
||||||
const ORDER_FAV_TIME = 'lastFavTime';
|
const ORDER_FAV_TIME = 'lastFavTime';
|
||||||
const ORDER_FAV_COUNT = 'favCount';
|
const ORDER_FAV_COUNT = 'favCount';
|
||||||
const ORDER_TAG_COUNT = 'tagCount';
|
const ORDER_TAG_COUNT = 'tagCount';
|
||||||
|
const ORDER_SCORE = 'score';
|
||||||
|
|
||||||
const REQUIREMENT_TAG = 'tag';
|
const REQUIREMENT_TAG = 'tag';
|
||||||
const REQUIREMENT_ID = 'id';
|
const REQUIREMENT_ID = 'id';
|
||||||
|
|
|
@ -43,6 +43,9 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
elseif ($token === 'tag_count')
|
elseif ($token === 'tag_count')
|
||||||
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_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');
|
throw new \BadMethodCallException('Not supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue