Fix video selection

This commit is contained in:
Logan Cusano
2025-08-02 02:23:55 -04:00
parent 1a5e460029
commit d39413d0ef

View File

@@ -97,7 +97,9 @@ async def get_random_unvoted_video(current_user: dict = Depends(is_user)):
if not unvoted_videos:
raise HTTPException(status_code=404, detail="No more videos to vote on!")
return Video(**unvoted_videos)
random_video = random.choice(unvoted_videos)
return Video(**random_video)
@router.post("/{video_id}/vote", status_code=status.HTTP_201_CREATED)