fix album ordering on SAS

This commit is contained in:
Thomas Girod 2025-04-12 18:09:39 +02:00
parent ed52a4f828
commit 2658244671

View File

@ -46,7 +46,9 @@ class AlbumController(ControllerBase):
@paginate(PageNumberPaginationExtra, page_size=50) @paginate(PageNumberPaginationExtra, page_size=50)
def fetch_album(self, filters: Query[AlbumFilterSchema]): def fetch_album(self, filters: Query[AlbumFilterSchema]):
"""General-purpose album search.""" """General-purpose album search."""
return filters.filter(Album.objects.viewable_by(self.context.request.user)) return filters.filter(
Album.objects.viewable_by(self.context.request.user).order_by("-date")
)
@route.get( @route.get(
"/autocomplete-search", "/autocomplete-search",
@ -63,7 +65,9 @@ class AlbumController(ControllerBase):
If you don't need the path of the albums, If you don't need the path of the albums,
do NOT use this route. do NOT use this route.
""" """
return filters.filter(Album.objects.viewable_by(self.context.request.user)) return filters.filter(
Album.objects.viewable_by(self.context.request.user).order_by("-date")
)
@api_controller("/sas/picture") @api_controller("/sas/picture")