Fixed direction errors

This commit is contained in:
Profitroll 2023-08-14 13:55:49 +02:00
parent 7011baff0f
commit c966a6de07
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 13 additions and 21 deletions

View File

@ -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(
{

View File

@ -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(
{
"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 = {
"user": current_user.user,
"album": album,
"filename": re.compile(q),
"caption": re.compile(caption),
}
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(
{