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(
|
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(
|
output["results"].append(
|
||||||
{
|
{
|
||||||
|
@ -393,31 +393,23 @@ async def video_find(
|
|||||||
"caption": re.compile(caption),
|
"caption": re.compile(caption),
|
||||||
}
|
}
|
||||||
elif caption is None:
|
elif caption is None:
|
||||||
db_query = list(
|
db_query = {
|
||||||
col_videos.find(
|
"user": current_user.user,
|
||||||
{"user": current_user.user, "album": album, "filename": re.compile(q)},
|
"album": album,
|
||||||
limit=page_size,
|
"filename": re.compile(q),
|
||||||
skip=skip,
|
}
|
||||||
).sort("dates.uploaded", DESCENDING)
|
|
||||||
)
|
|
||||||
db_query_count = {
|
db_query_count = {
|
||||||
"user": current_user.user,
|
"user": current_user.user,
|
||||||
"album": album,
|
"album": album,
|
||||||
"caption": re.compile(q),
|
"caption": re.compile(q),
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
db_query = list(
|
db_query = {
|
||||||
col_videos.find(
|
"user": current_user.user,
|
||||||
{
|
"album": album,
|
||||||
"user": current_user.user,
|
"filename": re.compile(q),
|
||||||
"album": album,
|
"caption": re.compile(caption),
|
||||||
"filename": re.compile(q),
|
}
|
||||||
"caption": re.compile(caption),
|
|
||||||
},
|
|
||||||
limit=page_size,
|
|
||||||
skip=skip,
|
|
||||||
).sort("dates.uploaded", DESCENDING)
|
|
||||||
)
|
|
||||||
db_query_count = {
|
db_query_count = {
|
||||||
"user": current_user.user,
|
"user": current_user.user,
|
||||||
"album": album,
|
"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(
|
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(
|
output["results"].append(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user