aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor/common.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-12-02 00:31:59 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2024-12-02 00:31:59 -0500
commit1981ccaaea6eab2cf32536ec5afe132a870914d8 (patch)
tree013f1e17d922d3a6abf7f57aa6a175c2ce5d93bc /gallery_dl/postprocessor/common.py
parentfc004701f923bb954a22c7fec2ae8d607e78cb2b (diff)
New upstream version 1.28.0.upstream/1.28.0
Diffstat (limited to 'gallery_dl/postprocessor/common.py')
-rw-r--r--gallery_dl/postprocessor/common.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/gallery_dl/postprocessor/common.py b/gallery_dl/postprocessor/common.py
index d4e1603..a9143a6 100644
--- a/gallery_dl/postprocessor/common.py
+++ b/gallery_dl/postprocessor/common.py
@@ -26,19 +26,27 @@ class PostProcessor():
if archive_path:
extr = job.extractor
archive_path = util.expand_path(archive_path)
- if not prefix:
- prefix = "_" + self.name.upper() + "_"
- archive_format = (
- options.get("archive-prefix", extr.category) +
- options.get("archive-format", prefix + extr.archive_fmt))
+
+ archive_prefix = options.get("archive-prefix")
+ if archive_prefix is None:
+ archive_prefix = extr.category
+
+ archive_format = options.get("archive-format")
+ if archive_format is None:
+ if prefix is None:
+ prefix = "_" + self.name.upper() + "_"
+ archive_format = prefix + extr.archive_fmt
+
try:
if "{" in archive_path:
archive_path = formatter.parse(archive_path).format_map(
job.pathfmt.kwdict)
self.archive = archive.DownloadArchive(
- archive_path, archive_format,
+ archive_path,
+ archive_prefix + archive_format,
options.get("archive-pragma"),
- "_archive_" + self.name)
+ "_archive_" + self.name,
+ )
except Exception as exc:
self.log.warning(
"Failed to open %s archive at '%s' (%s: %s)",