UPDATE: Added recommended categories as well as streamer data

BUGFIX: Fixed wrong datatypes
This commit is contained in:
JustIceO7
2025-01-31 03:52:25 +00:00
parent 908870f751
commit 1036494b7d
4 changed files with 42 additions and 25 deletions

View File

@@ -45,7 +45,7 @@ def followed_streamers(user_id: int) -> Optional[List[dict]]:
""", (user_id,))
return followed_streamers
def streamer_most_recent_stream(user_id: int) -> dict:
def streamer_most_recent_stream(user_id: int) -> Optional[dict]:
"""
Returns data of the most recent stream by a streamer
"""
@@ -57,6 +57,17 @@ def streamer_most_recent_stream(user_id: int) -> dict:
""", (user_id, user_id))
return most_recent_stream
def streamer_data(streamer_id: int) -> Optional[dict]:
"""
Returns information about the streamer
"""
with Database() as db:
data = db.fetchone("""
SELECT username, num_followering, isPartnered FROM users
WHERE user_id = ?
""", (streamer_id))
return data
def user_stream(user_id: int, stream_id: int) -> dict:
"""
Returns data of a streamers selected stream