Added order:file_size support to post searching
This commit is contained in:
parent
c78d9d62e6
commit
9c1a028c81
3 changed files with 4 additions and 1 deletions
1
TODO
1
TODO
|
@ -15,7 +15,6 @@ everything related to posts:
|
|||
- search order
|
||||
- order:comment_count
|
||||
- order:comment_time
|
||||
- order:file_size
|
||||
- order:random (at least unstable version)
|
||||
|
||||
- single post view
|
||||
|
|
|
@ -9,6 +9,7 @@ class PostFilter extends BasicFilter implements IFilter
|
|||
const ORDER_TAG_COUNT = 'tagCount';
|
||||
const ORDER_SCORE = 'score';
|
||||
const ORDER_LAST_EDIT_TIME = 'lastEditTime';
|
||||
const ORDER_FILE_SIZE = 'originalFileSize';
|
||||
|
||||
const REQUIREMENT_TAG = 'tag';
|
||||
const REQUIREMENT_ID = 'id';
|
||||
|
|
|
@ -94,6 +94,9 @@ class PostSearchParser extends AbstractSearchParser
|
|||
elseif ($token === 'score')
|
||||
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_SCORE;
|
||||
|
||||
elseif ($token === 'file_size')
|
||||
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_FILE_SIZE;
|
||||
|
||||
throw new \BadMethodCallException('Not supported');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue