Search: Add sort by "File Size" #2620
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
d58189ea8f
commit
ac84dce3aa
3 changed files with 12 additions and 8 deletions
|
@ -202,14 +202,15 @@ export default {
|
|||
{value: 'list', text: this.$gettext('List')},
|
||||
],
|
||||
'sorting': [
|
||||
{value: 'added', text: this.$gettext('Recently added')},
|
||||
{value: 'edited', text: this.$gettext('Recently edited')},
|
||||
{value: 'newest', text: this.$gettext('Newest first')},
|
||||
{value: 'oldest', text: this.$gettext('Oldest first')},
|
||||
{value: 'name', text: this.$gettext('Sort by file name')},
|
||||
{value: 'similar', text: this.$gettext('Group by similarity')},
|
||||
{value: 'relevance', text: this.$gettext('Most relevant')},
|
||||
{value: 'duration', text: this.$gettext('Duration')},
|
||||
{value: 'added', text: this.$gettext('Recently Added')},
|
||||
{value: 'newest', text: this.$gettext('Newest First')},
|
||||
{value: 'oldest', text: this.$gettext('Oldest First')},
|
||||
{value: 'relevance', text: this.$gettext('Most Relevant')},
|
||||
{value: 'similar', text: this.$gettext('Visual Similarity')},
|
||||
{value: 'name', text: this.$gettext('File Name')},
|
||||
{value: 'size', text: this.$gettext('File Size')},
|
||||
{value: 'duration', text: this.$gettext('Video Duration')},
|
||||
{value: 'edited', text: this.$gettext('Recently Edited')},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
@ -57,6 +57,7 @@ const (
|
|||
SortOrderDefault = ""
|
||||
SortOrderRelevance = "relevance"
|
||||
SortOrderDuration = "duration"
|
||||
SortOrderSize = "size"
|
||||
SortOrderCount = "count"
|
||||
SortOrderAdded = "added"
|
||||
SortOrderImported = "imported"
|
||||
|
|
|
@ -147,6 +147,8 @@ func searchPhotos(f form.SearchPhotos, sess *entity.Session, resultCols string)
|
|||
}
|
||||
case entity.SortOrderDuration:
|
||||
s = s.Order("photos.photo_duration DESC, files.time_index")
|
||||
case entity.SortOrderSize:
|
||||
s = s.Order("files.file_size DESC, files.time_index")
|
||||
case entity.SortOrderNewest:
|
||||
s = s.Order("files.time_index")
|
||||
case entity.SortOrderOldest:
|
||||
|
|
Loading…
Add table
Reference in a new issue