Feat: Update to VideoPage to display stream data;
This commit is contained in:
@@ -68,7 +68,8 @@ def get_recommended_categories() -> list | list[dict]:
|
||||
|
||||
return jsonify({'categories': categories})
|
||||
|
||||
@stream_bp.route('/get_streamer_data/<int:streamer_username>')
|
||||
|
||||
@stream_bp.route('/get_streamer_data/<string:streamer_username>')
|
||||
def get_streamer_data(streamer_username):
|
||||
"""
|
||||
Returns a given streamer's data
|
||||
@@ -98,7 +99,7 @@ def get_streamer_status(streamer_username):
|
||||
})
|
||||
|
||||
|
||||
@stream_bp.route('/get_stream_data/<string:streamer_username>', methods=['GET'])
|
||||
@stream_bp.route('/get_stream_data/<string:streamer_username>')
|
||||
def get_stream(streamer_username):
|
||||
"""
|
||||
Returns a streamer's most recent stream data
|
||||
@@ -119,7 +120,7 @@ def get_following_categories_streams():
|
||||
return jsonify(streams)
|
||||
|
||||
|
||||
@stream_bp.route('/get_stream_data/<string:streamer_username>/<int:stream_id>', methods=['GET'])
|
||||
@stream_bp.route('/get_stream_data/<string:streamer_username>/<int:stream_id>')
|
||||
def get_specific_stream(streamer_username, stream_id):
|
||||
"""
|
||||
Returns a streamer's stream data given stream_id
|
||||
@@ -132,7 +133,7 @@ def get_specific_stream(streamer_username, stream_id):
|
||||
abort(404)
|
||||
|
||||
@login_required
|
||||
@stream_bp.route('/get_followed_streamers', methods=['GET'])
|
||||
@stream_bp.route('/get_followed_streamers')
|
||||
def get_followed_streamers():
|
||||
"""
|
||||
Queries DB to get a list of followed streamers
|
||||
|
||||
@@ -46,12 +46,19 @@ INSERT INTO subscribes (user_id, subscribed_id, since, expires) VALUES
|
||||
(4, 104, '2024-09-12', '2025-01-12'),
|
||||
(5, 105, '2024-08-30', '2025-02-28');
|
||||
|
||||
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio) VALUES
|
||||
('GamerDude2', 'password123', 'gamerdude3@gmail.com', 3200, '7890', 0, 'Streaming my gaming adventures!');
|
||||
|
||||
SELECT * FROM users;
|
||||
SELECT * FROM streams;
|
||||
SELECT * FROM follows;
|
||||
SELECT * FROM user_preferences;
|
||||
SELECT * FROM subscribes;
|
||||
SELECT * FROM categories;
|
||||
SELECT * FROM streams;
|
||||
SELECT * FROM chat;
|
||||
SELECT * FROM tags;
|
||||
SELECT * FROM stream_tags;
|
||||
|
||||
-- To see all tables in the database
|
||||
SELECT name FROM sqlite_master WHERE type='table';
|
||||
|
||||
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio) VALUES
|
||||
('GamerDude2', 'password123', 'gamerdude3@gmail.com', 3200, '7890', 0, 'Streaming my gaming adventures!');
|
||||
|
||||
@@ -36,9 +36,9 @@ CREATE TABLE user_preferences
|
||||
user_id INT NOT NULL,
|
||||
category_id INT NOT NULL,
|
||||
favourability INT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY(user_id, category_id),
|
||||
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE,
|
||||
FOREIGN KEY(category_id) REFERENCES categories(category_id) ON DELETE CASCADE
|
||||
PRIMARY KEY (user_id, category_id),
|
||||
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (category_id) REFERENCES categories(category_id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS subscribes;
|
||||
@@ -49,8 +49,8 @@ CREATE TABLE subscribes
|
||||
since DATETIME NOT NULL,
|
||||
expires DATETIME NOT NULL,
|
||||
PRIMARY KEY (user_id),
|
||||
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE,
|
||||
FOREIGN KEY(subscribed_id) REFERENCES users(user_id) ON DELETE CASCADE
|
||||
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (subscribed_id) REFERENCES users(user_id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS followed_categories;
|
||||
|
||||
Reference in New Issue
Block a user