Added order:score support to post searching

This commit is contained in:
Marcin Kurczewski 2014-09-30 14:54:37 +02:00
parent e0ced89a9b
commit 736a25c3a4
3 changed files with 4 additions and 1 deletions

1
TODO
View file

@ -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

View file

@ -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';

View file

@ -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');
}