From: Guillaume Pellerin Date: Tue, 24 Dec 2024 11:33:39 +0000 (+0100) Subject: fix date condition X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=17a2aaa3454aa8e8499ea6bdb375006c572b4020;p=telecaster-server.git fix date condition --- diff --git a/bin/mastering/mastering.py b/bin/mastering/mastering.py index 52a67f7..a62909b 100755 --- a/bin/mastering/mastering.py +++ b/bin/mastering/mastering.py @@ -198,9 +198,16 @@ class TeleCasterMastering(object): path = os.path.abspath(file) filename, ext = os.path.splitext(file) ext = ext[1:] - date_dir = datetime.datetime.fromtimestamp(os.path.getmtime(file)) - if ext in self.source_formats and \ - (date_dir >= self.date_limit and self.date_filter) and \ + date_file = datetime.datetime.fromtimestamp(os.path.getmtime(file)) + + process = False + if self.date_filter: + if date_file >= self.date_limit: + process = True + else: + process = True + + if ext in self.source_formats and process and \ (not is_processed or self.force_mode): if ext == "webm": self.remux(file)