Skip to content

Commit

Permalink
show 5 last uploaded memes
Browse files Browse the repository at this point in the history
  • Loading branch information
ohld committed Jun 18, 2024
1 parent f5ca8e7 commit 1092a2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tgbot/handlers/upload/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def get_uploaded_memes_of_user_id(user_id: int) -> list[dict[str, Any]]:
AND S.added_by = {user_id}
AND S.type = 'user upload'
AND M.status IN ('ok', 'published')
ORDER BY M.created_at
ORDER BY M.created_at DESC
"""
return await fetch_all(text(query))

Expand Down
2 changes: 1 addition & 1 deletion src/tgbot/handlers/upload/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def handle_uploaded_memes_stats(

# show stats for last 5 uploads:
media = []
for uploaded_meme in uploaded_memes[-5:]:
for uploaded_meme in uploaded_memes[:5]:
views = uploaded_meme["nmemes_sent"]
likes = uploaded_meme["nlikes"]
dislikes = uploaded_meme["ndislikes"]
Expand Down

0 comments on commit 1092a2d

Please sign in to comment.