Albums: Sort regular albums by name on overview page #1777

This commit is contained in:
Michael Mayer 2021-11-29 14:48:42 +01:00
parent 65e83a9eee
commit f71aa17047
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ export default [
path: "/albums",
component: Albums,
meta: { title: $gettext("Albums"), auth: true },
props: { view: "album", staticFilter: { type: "album", order: "relevance" } },
props: { view: "album", staticFilter: { type: "album", order: "name" } },
},
{
name: "album",

View File

@ -77,16 +77,16 @@ func Albums(f form.SearchAlbums) (results AlbumResults, err error) {
s = s.Order("albums.album_favorite DESC, has_year, albums.album_year DESC, albums.album_month DESC, albums.album_title ASC, albums.album_uid DESC")
case entity.SortOrderPlace:
s = s.Order("albums.album_favorite DESC, albums.album_location, albums.album_title, albums.album_year DESC, albums.album_month ASC, albums.album_day ASC, albums.album_uid DESC")
case entity.SortOrderName:
s = s.Order("albums.album_title ASC, albums.album_uid DESC")
case entity.SortOrderPath:
s = s.Order("albums.album_path, albums.album_uid DESC")
case entity.SortOrderCategory:
s = s.Order("albums.album_category, albums.album_title, albums.album_uid DESC")
case entity.SortOrderSlug:
s = s.Order("albums.album_favorite DESC, albums.album_slug ASC, albums.album_uid DESC")
case entity.SortOrderName:
s = s.Order("albums.album_favorite DESC, albums.album_title ASC, albums.album_uid DESC")
default:
s = s.Order("albums.album_favorite DESC, has_year, albums.album_title ASC, albums.album_uid DESC")
s = s.Order("albums.album_favorite DESC, albums.album_title ASC, albums.album_uid DESC")
}
if f.ID != "" {