diff --git a/app/routers/search.py b/app/routers/search.py index da309db..949c78e 100644 --- a/app/routers/search.py +++ b/app/routers/search.py @@ -170,12 +170,6 @@ async def add_request( except sa.exc.IntegrityError: pass # ignore if already exists - if quality_config.get_auto_download(session) and user.is_above(GroupEnum.trusted): - # start querying and downloading if auto download is enabled - background_task.add_task( - background_start_query, asin=asin, requester_username=user.username - ) - background_task.add_task( send_all_notifications, event_type=EventEnum.on_new_request, @@ -183,6 +177,12 @@ async def add_request( book_asin=asin, ) + if quality_config.get_auto_download(session) and user.is_above(GroupEnum.trusted): + # start querying and downloading if auto download is enabled + background_task.add_task( + background_start_query, asin=asin, requester_username=user.username + ) + if audible_regions.get(region) is None: raise HTTPException(status_code=400, detail="Invalid region") if query: diff --git a/styles/globals.css b/styles/globals.css index 4c9abe0..44c5e1e 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -1,6 +1,9 @@ @import "tailwindcss"; @plugin "daisyui"; +/* Enables dark mode specific styling with "dark:" */ +@custom-variant dark (&:where(.dark, .dark *)); + @plugin "daisyui/theme" { name: "nord"; default: true; diff --git a/templates/base.html b/templates/base.html index 8cc80d0..17fb0bb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,12 +27,14 @@ "light-dark-toggle", )) { elem.classList.add("DARKCLASS"); + document.documentElement.classList.add("dark"); } } else { for (const elem of document.getElementsByClassName( "light-dark-toggle", )) { elem.classList.remove("DARKCLASS"); + document.documentElement.classList.remove("dark"); } } }; diff --git a/templates/wishlist_page/sources.html b/templates/wishlist_page/sources.html index e49cbfc..dd1d6d5 100644 --- a/templates/wishlist_page/sources.html +++ b/templates/wishlist_page/sources.html @@ -39,7 +39,7 @@
{% for source in sources %}