aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor/mtime.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-03-15 00:20:05 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-03-15 00:20:05 -0400
commit8167b5c0be04172b11188d5a62b5dfd9c92b484b (patch)
tree2e5e86f9aa02937f365de88a7bb6b8a3d0fe845a /gallery_dl/postprocessor/mtime.py
parent3ad4e25f8d7984bd38128ed406013ca2e32b9ac1 (diff)
parentc2e774d3f5a4499b8beb5a12ab46a0099b16b1e7 (diff)
Update upstream source from tag 'upstream/1.21.0'
Update to upstream version '1.21.0' with Debian dir b17d3fc3ba4860aceb7f154a3f477cef9bbb23d4
Diffstat (limited to 'gallery_dl/postprocessor/mtime.py')
-rw-r--r--gallery_dl/postprocessor/mtime.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gallery_dl/postprocessor/mtime.py b/gallery_dl/postprocessor/mtime.py
index d2f1915..098984a 100644
--- a/gallery_dl/postprocessor/mtime.py
+++ b/gallery_dl/postprocessor/mtime.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2019-2021 Mike Fährmann
+# Copyright 2019-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -17,7 +17,13 @@ class MtimePP(PostProcessor):
def __init__(self, job, options):
PostProcessor.__init__(self, job)
self.key = options.get("key", "date")
- job.register_hooks({"file": self.run}, options)
+
+ events = options.get("event")
+ if events is None:
+ events = ("file",)
+ elif isinstance(events, str):
+ events = events.split(",")
+ job.register_hooks({event: self.run for event in events}, options)
def run(self, pathfmt):
mtime = pathfmt.kwdict.get(self.key)