Fixed direction errors
This commit is contained in:
parent
7011baff0f
commit
c966a6de07
@ -621,7 +621,7 @@ async def photo_find(
|
||||
}
|
||||
|
||||
async for image in col_photos.find(db_query, limit=page_size, skip=skip).sort(
|
||||
"dates.uploaded", DESCENDING
|
||||
"dates.uploaded", direction=DESCENDING
|
||||
):
|
||||
output["results"].append(
|
||||
{
|
||||
|
@ -393,31 +393,23 @@ async def video_find(
|
||||
"caption": re.compile(caption),
|
||||
}
|
||||
elif caption is None:
|
||||
db_query = list(
|
||||
col_videos.find(
|
||||
{"user": current_user.user, "album": album, "filename": re.compile(q)},
|
||||
limit=page_size,
|
||||
skip=skip,
|
||||
).sort("dates.uploaded", DESCENDING)
|
||||
)
|
||||
db_query = {
|
||||
"user": current_user.user,
|
||||
"album": album,
|
||||
"filename": re.compile(q),
|
||||
}
|
||||
db_query_count = {
|
||||
"user": current_user.user,
|
||||
"album": album,
|
||||
"caption": re.compile(q),
|
||||
}
|
||||
else:
|
||||
db_query = list(
|
||||
col_videos.find(
|
||||
{
|
||||
db_query = {
|
||||
"user": current_user.user,
|
||||
"album": album,
|
||||
"filename": re.compile(q),
|
||||
"caption": re.compile(caption),
|
||||
},
|
||||
limit=page_size,
|
||||
skip=skip,
|
||||
).sort("dates.uploaded", DESCENDING)
|
||||
)
|
||||
}
|
||||
db_query_count = {
|
||||
"user": current_user.user,
|
||||
"album": album,
|
||||
@ -426,7 +418,7 @@ async def video_find(
|
||||
}
|
||||
|
||||
async for video in col_videos.find(db_query, limit=page_size, skip=skip).sort(
|
||||
"dates.uploaded", DESCENDING
|
||||
"dates.uploaded", direction=DESCENDING
|
||||
):
|
||||
output["results"].append(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user