This commit is contained in:
2025-03-05 22:41:33 +00:00
4 changed files with 10 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ const UserListItem: React.FC<UserListItemProps> = ({ title, username, isLive, on
return (
<div className="p-4 pb-10">
<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}
>
<img

View File

@@ -86,7 +86,7 @@ const StreamDashboard: React.FC<StreamDashboardProps> = ({ username, userId, isL
});
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`);
@@ -371,7 +371,7 @@ const StreamDashboard: React.FC<StreamDashboardProps> = ({ username, userId, isL
username={username || ""}
streamCategory={streamData.streamCategory || "Category"}
viewers={streamData.viewers}
thumbnail={thumbnailPreview.url || ""}
thumbnail={thumbnailPreview.url || `/stream/${username}/index.png`}
onItemClick={() => {
window.open(`/${username}`, "_blank");
}}

View File

@@ -7,7 +7,6 @@ import DynamicPageContent from "../components/Layout/DynamicPageContent";
import { getCategoryThumbnail } from "../utils/thumbnailUtils";
const ResultsPage: React.FC = () => {
const [overflow, setOverflow] = useState(false);
const location = useLocation();
const navigate = useNavigate();

View File

@@ -304,8 +304,9 @@ def publish_stream():
db.execute("""UPDATE users SET is_live = 1 WHERE user_id = ?""",
(user_id,))
# Update thumbnail periodically
update_thumbnail.apply_async((user_id,
# Update thumbnail periodically only if a custom thumbnail is not provided
if not stream_thumbnail:
update_thumbnail.apply_async((user_id,
path_manager.get_stream_file_path(username),
path_manager.get_current_stream_thumbnail_file_path(username),
THUMBNAIL_GENERATION_INTERVAL), countdown=10)
@@ -348,6 +349,8 @@ def update_stream():
SET title = ?, category_id = ?
WHERE user_id = ?""", (stream_title, get_category_id(stream_category), user_id))
print("GOT: " + stream_thumbnail, flush=True)
if stream_thumbnail:
# Set custom thumbnail status to true
db.execute("""UPDATE streams
@@ -362,6 +365,8 @@ def update_stream():
image.convert('RGB')
image.save(thumbnail_path, "PNG")
print(f"Should have saved it to {thumbnail_path}", flush=True)
return "Stream updated", 200