diff options
Diffstat (limited to 'app/ui')
| -rw-r--r-- | app/ui/hub.py | 3 | ||||
| -rw-r--r-- | app/ui/runview.py | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py index ef41d0b..fa05685 100644 --- a/app/ui/hub.py +++ b/app/ui/hub.py @@ -26,7 +26,6 @@ import json import shutil import sys import urllib.parse -from datetime import datetime from pathlib import Path from typing import Callable, Optional, Tuple @@ -1803,7 +1802,7 @@ def _prepare_run_config(backend: str, kwargs: dict info = get(backend) if info is not None: label = info.label - log_path = str(LOGS_FOLDER / f"audiobook_{datetime.now():%Y%m%d}.log") + log_path = str(logging_kit.stream_path("audiobook", LOGS_FOLDER)) # The run view points failures at this file, so make sure it exists # from the moment a run starts — even when the run dies before the # converter's setup_logging creates it. diff --git a/app/ui/runview.py b/app/ui/runview.py index b3a1ab0..19a8f64 100644 --- a/app/ui/runview.py +++ b/app/ui/runview.py @@ -479,7 +479,8 @@ class RunView(ScreenView): Output directory, one line per book with its generated file names and OK/FAIL status (plus the failure detail), a success count, and - the total elapsed time. + the total elapsed time. A failed run ends with the converter's log + file path, where the details behind the [FAIL] lines live. """ from converter.converter import AUDIOBOOKS_FOLDER lines = ["Audiobook generation finished", @@ -501,6 +502,10 @@ class RunView(ScreenView): finished = self.finished_at or self._now() elapsed = finished - (started if started is not None else finished) lines.append(f"Elapsed time: {_format_elapsed(elapsed)}") + if (self.phase == "error" or ok_count < total) \ + and self.config.log_path: + lines.append(f"Full details in the log file: " + f"{self.config.log_path}") return "\n".join(lines) _server_stopped_confirmed = False |
