Patch: Fix to StreamerRoute to correctly send user to UserPage/VideoPage;
Update: Display Category Thumbnails
This commit is contained in:
@@ -42,11 +42,11 @@ def get_recommended_streams() -> list[dict]:
|
||||
@stream_bp.route('/get_categories')
|
||||
def get_categories() -> list[dict]:
|
||||
"""
|
||||
Returns a list of streams in the most popular category
|
||||
Returns a list of most watched categories
|
||||
"""
|
||||
|
||||
category_data = most_popular_category()
|
||||
streams = recommendations_based_on_category(category_data["category_id"])
|
||||
streams = recommendations_based_on_category(category_data['category_id'])
|
||||
return jsonify(streams)
|
||||
|
||||
@login_required
|
||||
|
||||
@@ -49,3 +49,11 @@ CREATE TABLE streams
|
||||
FOREIGN KEY (category_id) REFERENCES categories(category_id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
|
||||
SELECT users.user_id, title, username, num_viewers, category_name
|
||||
FROM streams
|
||||
JOIN users ON users.user_id = streams.user_id
|
||||
JOIN categories ON streams.category_id = categories.category_id
|
||||
ORDER BY num_viewers DESC
|
||||
LIMIT 25;
|
||||
@@ -61,7 +61,7 @@ def default_recommendations():
|
||||
JOIN users ON users.user_id = streams.user_id
|
||||
JOIN categories ON streams.category_id = categories.category_id
|
||||
ORDER BY num_viewers DESC
|
||||
LIMIT 25
|
||||
LIMIT 25;
|
||||
""")
|
||||
db.close_connection()
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user