Merge branch 'main' of https://github.com/john-david3/cs3305-team11
This commit is contained in:
@@ -80,7 +80,7 @@ const UserListItem: React.FC<UserListItemProps> = ({ title, username, isLive, on
|
|||||||
return (
|
return (
|
||||||
<div className="p-4 pb-10">
|
<div className="p-4 pb-10">
|
||||||
<div
|
<div
|
||||||
className={`group relative w-fit flex flex-col bg-purple-900 rounded-tl-xl rounded-xl min-h-[calc((20vw+20vh)/3)] max-w-[calc((27vw+27vh)/2)] justify-end items-center cursor-pointer mx-auto hover:bg-purple-600 hover:scale-105 z-50 transition-all ${extraClasses}`}
|
className={`group relative ${extraClasses} overflow-hidden flex-shrink-0 flex flex-col bg-purple-900 rounded-lg cursor-pointer mx-auto hover:bg-purple-600 hover:scale-105 transition-all`}
|
||||||
onClick={onItemClick}
|
onClick={onItemClick}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const StreamDashboard: React.FC<StreamDashboardProps> = ({ username, userId, isL
|
|||||||
});
|
});
|
||||||
|
|
||||||
const time = Math.floor(
|
const time = Math.floor(
|
||||||
(Date.now() - new Date(data.startTime).getTime()) / 60000 // Convert to minutes
|
(Date.now() - new Date(data.start_time).getTime()) / 60000 // Convert to minutes
|
||||||
);
|
);
|
||||||
|
|
||||||
if (time < 60) setTimeStarted(`${time}m ago`);
|
if (time < 60) setTimeStarted(`${time}m ago`);
|
||||||
@@ -371,7 +371,7 @@ const StreamDashboard: React.FC<StreamDashboardProps> = ({ username, userId, isL
|
|||||||
username={username || ""}
|
username={username || ""}
|
||||||
streamCategory={streamData.streamCategory || "Category"}
|
streamCategory={streamData.streamCategory || "Category"}
|
||||||
viewers={streamData.viewers}
|
viewers={streamData.viewers}
|
||||||
thumbnail={thumbnailPreview.url || ""}
|
thumbnail={thumbnailPreview.url || `/stream/${username}/index.png`}
|
||||||
onItemClick={() => {
|
onItemClick={() => {
|
||||||
window.open(`/${username}`, "_blank");
|
window.open(`/${username}`, "_blank");
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import DynamicPageContent from "../components/Layout/DynamicPageContent";
|
|||||||
import { getCategoryThumbnail } from "../utils/thumbnailUtils";
|
import { getCategoryThumbnail } from "../utils/thumbnailUtils";
|
||||||
|
|
||||||
const ResultsPage: React.FC = () => {
|
const ResultsPage: React.FC = () => {
|
||||||
const [overflow, setOverflow] = useState(false);
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
|||||||
@@ -304,7 +304,8 @@ def publish_stream():
|
|||||||
db.execute("""UPDATE users SET is_live = 1 WHERE user_id = ?""",
|
db.execute("""UPDATE users SET is_live = 1 WHERE user_id = ?""",
|
||||||
(user_id,))
|
(user_id,))
|
||||||
|
|
||||||
# Update thumbnail periodically
|
# Update thumbnail periodically only if a custom thumbnail is not provided
|
||||||
|
if not stream_thumbnail:
|
||||||
update_thumbnail.apply_async((user_id,
|
update_thumbnail.apply_async((user_id,
|
||||||
path_manager.get_stream_file_path(username),
|
path_manager.get_stream_file_path(username),
|
||||||
path_manager.get_current_stream_thumbnail_file_path(username),
|
path_manager.get_current_stream_thumbnail_file_path(username),
|
||||||
@@ -348,6 +349,8 @@ def update_stream():
|
|||||||
SET title = ?, category_id = ?
|
SET title = ?, category_id = ?
|
||||||
WHERE user_id = ?""", (stream_title, get_category_id(stream_category), user_id))
|
WHERE user_id = ?""", (stream_title, get_category_id(stream_category), user_id))
|
||||||
|
|
||||||
|
print("GOT: " + stream_thumbnail, flush=True)
|
||||||
|
|
||||||
if stream_thumbnail:
|
if stream_thumbnail:
|
||||||
# Set custom thumbnail status to true
|
# Set custom thumbnail status to true
|
||||||
db.execute("""UPDATE streams
|
db.execute("""UPDATE streams
|
||||||
@@ -362,6 +365,8 @@ def update_stream():
|
|||||||
image.convert('RGB')
|
image.convert('RGB')
|
||||||
image.save(thumbnail_path, "PNG")
|
image.save(thumbnail_path, "PNG")
|
||||||
|
|
||||||
|
print(f"Should have saved it to {thumbnail_path}", flush=True)
|
||||||
|
|
||||||
return "Stream updated", 200
|
return "Stream updated", 200
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user