diff --git a/main.py b/main.py index 8fd200a..6b036af 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ from nicegui import background_tasks, app import config import globals -import web +import web.routes from movies.db import MoviesDB from rooms.db import RoomsDB from users.db import UsersDB @@ -57,7 +57,7 @@ async def after_startup(): asyncio.run(before_startup()) app.on_startup(after_startup()) -web.ui.run( +web.routes.ui.run( host=config.HOST, port=config.PORT, dark=config.USE_DARK_THEME, diff --git a/web/__init__.py b/web/__init__.py deleted file mode 100644 index ef90dd6..0000000 --- a/web/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from web.web import * diff --git a/web/custom_widgets/__init__.py b/web/custom_widgets/__init__.py index 1a4be00..71b2afb 100644 --- a/web/custom_widgets/__init__.py +++ b/web/custom_widgets/__init__.py @@ -2,3 +2,5 @@ from web.custom_widgets.header import draw_header from web.custom_widgets.content_dialog import ContentDialog from web.custom_widgets.content_card import ContentCard from web.custom_widgets.PlyrVideoPlayer import PlyrVideoPlayer + +__all__ = ["draw_header", "ContentDialog", "ContentCard", "PlyrVideoPlayer",] \ No newline at end of file diff --git a/web/custom_widgets/content_dialog.py b/web/custom_widgets/content_dialog.py index f0be797..36fb7f3 100644 --- a/web/custom_widgets/content_dialog.py +++ b/web/custom_widgets/content_dialog.py @@ -49,9 +49,9 @@ class ContentDialog(ui.dialog): itertools.chain.from_iterable([s.episodes for s in self.content.seasons])]) ui.html(f"Total Runtime: {convert_runtime(total_runtime)}").style("font-size: 12px") if self.content.in_production: - ui.html(f"Currently in production").style("font-size: 12px") + ui.html("Currently in production").style("font-size: 12px") else: - ui.html(f"Finished").style("font-size: 12px") + ui.html("Finished").style("font-size: 12px") with self.card, ui.row(wrap=False).classes("w-full").style("display: flex; justify-content: center;"): ui.button("Create Room").on_click(self.create_room).props("rounded push") diff --git a/web/pages/__init__.py b/web/pages/__init__.py index 614a62d..cd44301 100644 --- a/web/pages/__init__.py +++ b/web/pages/__init__.py @@ -2,3 +2,5 @@ import web.pages.all_rooms as rooms_page import web.pages.contents as movies_page import web.pages.index as index_page import web.pages.room as room_page + +__all__ = ["rooms_page", "movies_page", "index_page", "room_page"] \ No newline at end of file diff --git a/web/pages/room.py b/web/pages/room.py index 49295c1..66f1fde 100644 --- a/web/pages/room.py +++ b/web/pages/room.py @@ -13,7 +13,7 @@ from web.misc import check_user, is_portrait def _check_room(room_uid: str): - return not globals.ROOMS_DATABASE.by_uid.get(room_uid) is None + return globals.ROOMS_DATABASE.by_uid.get(room_uid) is not None async def _join_room(room_uid: str, user_uid: str): diff --git a/web/web.py b/web/routes.py similarity index 88% rename from web/web.py rename to web/routes.py index d77324c..28f620c 100644 --- a/web/web.py +++ b/web/routes.py @@ -2,7 +2,7 @@ from nicegui import ui from web.custom_widgets.PlyrVideoPlayer import install_plyr from web.misc import default_page_setup -from web.pages import * +from web.pages import index_page, movies_page, rooms_page, room_page @ui.page("/")