diff --git a/API.md b/API.md index bcf9ef91..b9894a86 100644 --- a/API.md +++ b/API.md @@ -585,7 +585,8 @@ or on error "title": "Example title", "archive_id": "generic 1", "metadata": { - "source_task": "...", + "source_id": "...", + "source_name": "...", "source_handler": "GenericTaskHandler" } } diff --git a/Dockerfile b/Dockerfile index 0132a114..51028cce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,9 +51,12 @@ RUN mkdir /config /downloads && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime ARCH="$(dpkg --print-architecture)" && \ EXTRA_PACKAGES="" && \ if [ "$ARCH" = "amd64" ]; then EXTRA_PACKAGES="intel-media-va-driver i965-va-driver libmfx-gen1.2"; fi && \ - apt-get install -y --no-install-recommends \ + apt-get install -y --no-install-recommends locales \ bash mkvtoolnix patch aria2 curl ca-certificates xz-utils git sqlite3 tzdata file libmagic1 vainfo ${EXTRA_PACKAGES} \ - && useradd -u ${USER_ID:-1000} -U -d /app -s /bin/bash app \ + && useradd -u ${USER_ID:-1000} -U -d /app -s /bin/bash app && \ + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh / @@ -70,6 +73,9 @@ COPY --from=denoland/deno:latest /usr/bin/deno /usr/bin/deno COPY --chown=app:app ./healthcheck.sh /usr/local/bin/healthcheck ENV PATH="/opt/python/bin:$PATH" +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 RUN chown -R app:app /config /downloads && \ chmod +x /usr/local/bin/healthcheck /usr/bin/mp4box /usr/bin/ffmpeg /usr/bin/ffprobe /usr/bin/deno diff --git a/app/library/Tasks.py b/app/library/Tasks.py index 38ef7281..f8ed0237 100644 --- a/app/library/Tasks.py +++ b/app/library/Tasks.py @@ -525,6 +525,11 @@ class Tasks(metaclass=Singleton): "template": template, "cli": cli, "auto_start": task.auto_start, + "extras": { + "source_name": task.name, + "source_id": task.id, + "source_handler": __class__.__name__, + }, } ) ) @@ -778,7 +783,7 @@ class HandleTask: "template": task.template or "", "cli": task.cli or "", "auto_start": task.auto_start, - "extras": {"source_task": task.id, "source_handler": handler.__name__}, + "extras": {"source_name": task.name, "source_id": task.id, "source_handler": handler.__name__}, } ) @@ -876,11 +881,9 @@ class HandleTask: if extraction.metadata: combined_failure_metadata.update(extraction.metadata) - failure_error = extraction.error if extraction.error else extraction.message - return TaskFailure( message=extraction.message, - error=failure_error, + error=extraction.error if extraction.error else extraction.message, metadata=combined_failure_metadata, ) @@ -918,22 +921,22 @@ class HandleTask: return handlers async def _handle_item_error(self, event, _name, **_kwargs): - item = getattr(event, "data", None) + item: ItemDTO | None = getattr(event, "data", None) if not isinstance(item, ItemDTO): return - extras = getattr(item, "extras", {}) or {} - handler_name = extras.get("source_handler") + extras: dict[Any, Any] = getattr(item, "extras", {}) or {} + handler_name: Any | None = extras.get("source_handler") if not handler_name: return - archive_id = item.archive_id + archive_id: str | None = item.archive_id if not archive_id: return - queued = self._queued.get(handler_name) + queued: set[str] | None = self._queued.get(handler_name) if queued: queued.discard(archive_id) - failures = self._failure_count.setdefault(handler_name, {}) + failures: dict[str, int] = self._failure_count.setdefault(handler_name, {}) failures[archive_id] = failures.get(archive_id, 0) + 1 diff --git a/app/tests/test_tasks.py b/app/tests/test_tasks.py index 71ceed25..6be34e0b 100644 --- a/app/tests/test_tasks.py +++ b/app/tests/test_tasks.py @@ -773,6 +773,11 @@ class TestTasks: "template": "test_template", "cli": "--write-info-json", "auto_start": True, + "extras": { + "source_name": "Test Task", + "source_id": "task1", + "source_handler": "Tasks", + }, } ) diff --git a/ui/app/components/Connection.vue b/ui/app/components/Connection.vue new file mode 100644 index 00000000..0e5ac902 --- /dev/null +++ b/ui/app/components/Connection.vue @@ -0,0 +1,16 @@ + + + diff --git a/ui/app/components/Settings.vue b/ui/app/components/Settings.vue index 54c671cf..312f176b 100644 --- a/ui/app/components/Settings.vue +++ b/ui/app/components/Settings.vue @@ -19,8 +19,8 @@
- -
diff --git a/ui/app/components/Simple.vue b/ui/app/components/Simple.vue index b90805cc..a24e7dc9 100644 --- a/ui/app/components/Simple.vue +++ b/ui/app/components/Simple.vue @@ -6,8 +6,9 @@
@@ -542,6 +543,18 @@ const showMessage = (item: StoreItem) => { } return (item.msg?.length || 0) > 0 } + +const connectionStatusColor = computed(() => { + switch (socketStore.connectionStatus) { + case 'connected': + return 'has-text-success' + case 'connecting': + return 'has-text-warning fa-spin' + case 'disconnected': + default: + return 'has-text-danger' + } +})