REFACTOR: Moved user routes into user blueprint, and grouped them, fixed some (not all) routes

This commit is contained in:
2025-02-06 01:00:46 +00:00
parent 4b0bbb12ae
commit 6a8509ca42
7 changed files with 84 additions and 75 deletions

View File

@@ -34,18 +34,6 @@ def get_followed_live_streams(user_id: int) -> Optional[List[dict]]:
""", (user_id,))
return live_streams
def get_followed_streamers(user_id: int) -> Optional[List[dict]]:
"""
Returns a list of streamers who the user follows
"""
with Database() as db:
followed_streamers = db.fetchall("""
SELECT user_id, username
FROM users
WHERE user_id IN (SELECT followed_id FROM follows WHERE user_id = ?);
""", (user_id,))
return followed_streamers
def get_vod(vod_id: int) -> dict:
"""
Returns data of a streamers vod
@@ -71,17 +59,6 @@ def get_user_vods(user_id: int):
return vods
def get_streamer_data(user_id: int) -> Optional[dict]:
"""
Returns information about the streamer
"""
with Database() as db:
data = db.fetchone("""
SELECT username, bio, num_followers, is_partnered FROM users
WHERE user_id = ?;
""", (user_id,))
return data
def generate_thumbnail(user_id: int) -> None:
"""
Generates the thumbnail of a stream