Added order:file_size support to post searching

This commit is contained in:
Marcin Kurczewski 2014-10-03 19:37:19 +02:00
parent c78d9d62e6
commit 9c1a028c81
3 changed files with 4 additions and 1 deletions

1
TODO
View file

@ -15,7 +15,6 @@ everything related to posts:
- search order - search order
- order:comment_count - order:comment_count
- order:comment_time - order:comment_time
- order:file_size
- order:random (at least unstable version) - order:random (at least unstable version)
- single post view - single post view

View file

@ -9,6 +9,7 @@ class PostFilter extends BasicFilter implements IFilter
const ORDER_TAG_COUNT = 'tagCount'; const ORDER_TAG_COUNT = 'tagCount';
const ORDER_SCORE = 'score'; const ORDER_SCORE = 'score';
const ORDER_LAST_EDIT_TIME = 'lastEditTime'; const ORDER_LAST_EDIT_TIME = 'lastEditTime';
const ORDER_FILE_SIZE = 'originalFileSize';
const REQUIREMENT_TAG = 'tag'; const REQUIREMENT_TAG = 'tag';
const REQUIREMENT_ID = 'id'; const REQUIREMENT_ID = 'id';

View file

@ -94,6 +94,9 @@ class PostSearchParser extends AbstractSearchParser
elseif ($token === 'score') elseif ($token === 'score')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_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'); throw new \BadMethodCallException('Not supported');
} }