second commit
This commit is contained in:
@@ -301,8 +301,11 @@ class Config:
|
||||
config.sequence_prefix_format.format(seq=1)
|
||||
except (KeyError, IndexError, ValueError):
|
||||
r.problems.append("SEQUENCE_PREFIX_FORMAT must be a format string using {seq}, e.g. '{seq:03d} - '")
|
||||
import tempfile
|
||||
|
||||
resolved = config.download_dir.resolve()
|
||||
if resolved in {Path("/").resolve(), Path.home().resolve(), PROJECT_DIR.resolve()} or len(resolved.parts) < 3:
|
||||
shared = {Path(p).resolve() for p in ("/", "/tmp", "/var/tmp", tempfile.gettempdir(), Path.home(), PROJECT_DIR)}
|
||||
if resolved in shared or len(resolved.parts) < 3:
|
||||
r.problems.append(
|
||||
f"DOWNLOAD_DIR={config.download_dir} is not a dedicated directory; use e.g. 'downloads' or '/tmp/telegram_drive_bot'"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user