]> git.parisson.com Git - telecaster-server.git/commitdiff
fix date condition
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 24 Dec 2024 11:33:39 +0000 (12:33 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 24 Dec 2024 11:33:39 +0000 (12:33 +0100)
bin/mastering/mastering.py

index 52a67f70527daa20ae5f41ef95aa954d624dda63..a62909b6d095d67ddaedcbde2ed4d1a17fff6766 100755 (executable)
@@ -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)