diff --git a/.vscode/settings.json b/.vscode/settings.json index 289067c3..3875a991 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -76,6 +76,7 @@ "socketio", "timespec", "tmpfilename", + "ungroup", "upgrader", "urandom", "urlsafe", diff --git a/app/library/DownloadQueue.py b/app/library/DownloadQueue.py index ff5cb171..cb27f098 100644 --- a/app/library/DownloadQueue.py +++ b/app/library/DownloadQueue.py @@ -360,7 +360,7 @@ class DownloadQueue(metaclass=Singleton): starts_in.replace(tzinfo=UTC) if starts_in.tzinfo is None else starts_in.astimezone(UTC) ) starts_in = starts_in + timedelta(minutes=5, seconds=dl.extras.get("duration", 0)) - dlInfo.info.error += f" Download will start at {starts_in.isoformat()}." + dlInfo.info.error += f" Download will start at {starts_in.astimezone().isoformat()}." _requeue = False except Exception as e: LOG.error(f"Failed to parse live_in date '{release_in}'. {e!s}") @@ -917,7 +917,7 @@ class DownloadQueue(metaclass=Singleton): premiere_ends: datetime = starts_in + timedelta(minutes=5, seconds=duration) if time_now < premiere_ends: LOG.debug( - f"Item '{item_ref}' is premiering, download will start in '{(starts_in.astimezone() + timedelta(minutes=5, seconds=duration)).isoformat()}'" + f"Item '{item_ref}' is premiering, download will start in '{(starts_in + timedelta(minutes=5, seconds=duration)).astimezone().isoformat()}'" ) continue diff --git a/app/library/HttpAPI.py b/app/library/HttpAPI.py index d567809f..ab073695 100644 --- a/app/library/HttpAPI.py +++ b/app/library/HttpAPI.py @@ -44,7 +44,6 @@ class HttpAPI: "config": self.config, "notify": self._notify, "cache": self.cache, - "app": self.app, "http_api": self, "root_path": self.rootPath, }.items() diff --git a/app/library/Services.py b/app/library/Services.py index dabfa640..bf9d93cd 100644 --- a/app/library/Services.py +++ b/app/library/Services.py @@ -1,9 +1,11 @@ import inspect +import logging from typing import Any, TypeVar from app.library.Singleton import Singleton T = TypeVar("T") +LOG: logging.Logger = logging.getLogger(__name__) class Services(metaclass=Singleton): @@ -50,6 +52,10 @@ class Services(metaclass=Singleton): sig = inspect.signature(handler) expected_args = sig.parameters.keys() filtered = {k: v for k, v in context.items() if k in expected_args} + + if missing_args := expected_args - filtered.keys(): + LOG.error(f"Missing arguments for handler '{handler.__name__}': {missing_args}") + return await handler(**filtered) def handle_sync(self, handler: callable, **kwargs) -> Any: @@ -58,4 +64,8 @@ class Services(metaclass=Singleton): sig = inspect.signature(handler) expected_args = sig.parameters.keys() filtered = {k: v for k, v in context.items() if k in expected_args} + + if missing_args := expected_args - filtered.keys(): + LOG.error(f"Missing arguments for handler '{handler.__name__}': {missing_args}") + return handler(**filtered) diff --git a/app/library/Tasks.py b/app/library/Tasks.py index a20dfdb7..f439aea7 100644 --- a/app/library/Tasks.py +++ b/app/library/Tasks.py @@ -152,7 +152,7 @@ class Tasks(metaclass=Singleton): self._tasks.append(task) - if not task.timer: + if not task.timer or "[only_handler]" in task.name: continue try: diff --git a/app/main.py b/app/main.py index 42f91235..8152d024 100644 --- a/app/main.py +++ b/app/main.py @@ -25,6 +25,7 @@ from app.library.HttpSocket import HttpSocket from app.library.Notifications import Notification from app.library.Presets import Presets from app.library.Scheduler import Scheduler +from app.library.Services import Services from app.library.Tasks import Tasks LOG = logging.getLogger("app") @@ -38,6 +39,8 @@ class Main: self._config = Config.get_instance(is_native=is_native) self._app = web.Application() + Services.get_instance().add("app", self._app) + if self._config.debug: loop = asyncio.get_event_loop() loop.set_debug(True) diff --git a/ui/assets/css/style.css b/ui/assets/css/style.css index fb8781d3..83fa61ca 100644 --- a/ui/assets/css/style.css +++ b/ui/assets/css/style.css @@ -332,3 +332,7 @@ hr { .is-bold { font-weight: bold; } + +.fa-spin-10 { + --fa-animation-iteration-count: 10; +} diff --git a/ui/components/History.vue b/ui/components/History.vue index 88508196..0aecc6ee 100644 --- a/ui/components/History.vue +++ b/ui/components/History.vue @@ -22,17 +22,16 @@ -
-
-
- - -
-
- +
+ + + Information @@ -235,27 +238,26 @@
- - {{ formatTime(item.extras.duration) }} - +
+
+ + {{ formatTime(item.extras.duration) }} + +
+
+ +
+
+ +
- - - - - - - - - - - - +
@@ -298,10 +300,10 @@
- + v-if="'not_live' === item.status && (item.live_in || item.extras?.release_in)"> +
{{ formatBytes(item.file_size) }}
-
- -
@@ -346,8 +341,24 @@
-
+
+ + + + Information @@ -417,12 +428,12 @@ diff --git a/ui/components/NewDownload.vue b/ui/components/NewDownload.vue index da5b6173..d330f1da 100644 --- a/ui/components/NewDownload.vue +++ b/ui/components/NewDownload.vue @@ -89,7 +89,7 @@
@@ -103,7 +103,7 @@
- Use this separate multiple URLs in the input field. + Use this to separate multiple URLs in the input field.
diff --git a/ui/components/Queue.vue b/ui/components/Queue.vue index 8d0d3950..d844d445 100644 --- a/ui/components/Queue.vue +++ b/ui/components/Queue.vue @@ -142,17 +142,31 @@ {{ item.title }}
- - {{ formatTime(item.extras.duration) }} - +
- - - - +
+ + {{ formatTime(item.extras.duration) }} + +
+
+ + + +
+
+ +
+
+ +
+
@@ -194,29 +208,19 @@ v-if="item.downloaded_bytes"> {{ formatBytes(item.downloaded_bytes) }}
-
- -
+
diff --git a/ui/components/TaskForm.vue b/ui/components/TaskForm.vue index a7cace0e..8c9e66dc 100644 --- a/ui/components/TaskForm.vue +++ b/ui/components/TaskForm.vue @@ -250,6 +250,8 @@ and automatically queues any you haven’t downloaded yet.
  • To opt out of RSS monitoring for a specific task, append [no_handler] to that task’s name.
  • +
  • To have the task only monitor RSS, set a timer and add [only_handler] to that task’s name. +
  • RSS Feed monitoring will only work if you have --download-archive set in command options for ytdlp.cli, preset or task.
  • If you don't have --download-archive set but YTP_KEEP_ARCHIVE environment diff --git a/ui/pages/index.vue b/ui/pages/index.vue index 465f0db1..1a4fb358 100644 --- a/ui/pages/index.vue +++ b/ui/pages/index.vue @@ -23,7 +23,7 @@

    -