mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Merge aca649da9d into 5682b3df2e
This commit is contained in:
commit
f146e94999
1 changed files with 10 additions and 2 deletions
|
|
@ -199,9 +199,17 @@ func searchPhotos(frm form.SearchPhotos, sess *entity.Session, resultCols string
|
|||
s = s.Where("files.file_diff > 0")
|
||||
s = s.Order(OrderExpr("photos.photo_color ASC, photos.cell_id ASC, files.file_diff, files.photo_id, files.time_index", frm.Reverse))
|
||||
case sortby.Name:
|
||||
s = s.Order(OrderExpr("photos.photo_path ASC, photos.photo_name ASC, files.time_index", frm.Reverse))
|
||||
if entity.DbDialect() == entity.MySQL {
|
||||
s = s.Order(OrderExpr("NATURAL_SORT_KEY(photos.photo_path) ASC, NATURAL_SORT_KEY(photos.photo_name) ASC, files.time_index", frm.Reverse))
|
||||
} else {
|
||||
s = s.Order(OrderExpr("photos.photo_path ASC, photos.photo_name ASC, files.time_index", frm.Reverse))
|
||||
}
|
||||
case sortby.Title:
|
||||
s = s.Order(OrderExpr("photos.photo_title ASC, photos.photo_name ASC, files.time_index", frm.Reverse))
|
||||
if entity.DbDialect() == entity.MySQL {
|
||||
s = s.Order(OrderExpr("NATURAL_SORT_KEY(photos.photo_title) ASC, NATURAL_SORT_KEY(photos.photo_name) ASC, files.time_index", frm.Reverse))
|
||||
} else {
|
||||
s = s.Order(OrderExpr("photos.photo_title ASC, photos.photo_name ASC, files.time_index", frm.Reverse))
|
||||
}
|
||||
case sortby.Random:
|
||||
s = s.Order(sortby.RandomExpr(s.Dialect()))
|
||||
case sortby.Default, sortby.Imported, sortby.Added:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue