feat: support filter by year in browse by folder mode

This commit is contained in:
sentriz
2021-08-23 21:30:11 +01:00
parent ccc0e3c58d
commit 6e2d4f73c5

View File

@@ -106,6 +106,12 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response {
q = q.Order("parent_albums.right_path")
case "alphabeticalByName":
q = q.Order("right_path")
case "byYear":
q = q.Where(
"tag_year BETWEEN ? AND ?",
params.GetOrInt("toYear", 2200),
params.GetOrInt("fromYear", 1800))
q = q.Order("tag_year")
case "frequent":
user := r.Context().Value(CtxUser).(*db.User)
q = q.Joins(`