url parsing flox ignore

This commit is contained in:
death916 2025-06-05 05:29:07 -07:00
parent a37f680886
commit b6ce850055
3 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View file

@ -19,3 +19,5 @@ assets*
*.log
*.logs
*log
*.flox
.flox

View file

@ -64,6 +64,8 @@ class State(rx.State):
def go_to_page(self, page: str):
self.current_page = page
@rx.event(background=True)
async def update_current_yt_video(self):
"""Fetch the current YouTube video in the background."""

View file

@ -38,9 +38,8 @@ def home():
rx.heading("Whats New:", size="8", color="#ffffff"),
rx.html(
f"""
<iframe width="350" height="200" src={rx.cond(State.current_yt_video.contains('v='), f"https://www.youtube.com/embed/{State.current_yt_video.split('v=')[1]}", "about:blank")} title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="350" height="200" src={rx.cond(State.current_yt_video.contains('v='), f"https://www.youtube.com/embed/{State.current_yt_video.split('v=')[1].split('&')[0]}", "about:blank")} title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
"""
),
rx.html(