]> git.parisson.com Git - telecaster-server.git/commitdiff
even better loggin master
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 24 Dec 2024 12:05:18 +0000 (13:05 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Tue, 24 Dec 2024 12:05:18 +0000 (13:05 +0100)
bin/mastering/mastering.py

index e2b0e72e457da1908214f38f679c8c0adf086b8b..63862c2675838d0f0da05d1a62e651434186482a 100755 (executable)
@@ -99,6 +99,7 @@ class TeleCasterMastering(object):
     def find_best_offset(self, files):
         offsets = {}
         for file in files:
     def find_best_offset(self, files):
         offsets = {}
         for file in files:
+            log = file + '.log'
             others = files.copy()
             others.remove(file)
             offsets[file] = {}
             others = files.copy()
             others.remove(file)
             offsets[file] = {}
@@ -108,6 +109,7 @@ class TeleCasterMastering(object):
                 offset = self.get_offset(file, other)
                 offsets[file]['offsets'][other] = offset
                 offsets[file]['offsets_sum'] += offset
                 offset = self.get_offset(file, other)
                 offsets[file]['offsets'][other] = offset
                 offsets[file]['offsets_sum'] += offset
+            self.touch(log)
 
         # print(offsets)
         min_offset = sorted(offsets.items(), key=lambda x: x[1]['offsets_sum'])[0]
 
         # print(offsets)
         min_offset = sorted(offsets.items(), key=lambda x: x[1]['offsets_sum'])[0]
@@ -178,6 +180,7 @@ class TeleCasterMastering(object):
             for dir in dirs:
                 path = root + os.sep + dir
                 print(path)
             for dir in dirs:
                 path = root + os.sep + dir
                 print(path)
+                is_processed = self.is_processed(path)
                 dir_files = os.listdir(path)
                 source_files = []
                 for file in dir_files:
                 dir_files = os.listdir(path)
                 source_files = []
                 for file in dir_files:
@@ -190,8 +193,6 @@ class TeleCasterMastering(object):
 
                 if source_files:
                     offsets = {}
 
                 if source_files:
                     offsets = {}
-                    is_processed = self.is_processed(source_files)
-
                     if len(source_files) > 1 and self.auto_offset_mode and (not is_processed or self.force_mode):
                         date_file = datetime.datetime.fromtimestamp(os.path.getmtime(source_files[0]))
                         if date_file >= self.date_limit and self.date_filter:
                     if len(source_files) > 1 and self.auto_offset_mode and (not is_processed or self.force_mode):
                         date_file = datetime.datetime.fromtimestamp(os.path.getmtime(source_files[0]))
                         if date_file >= self.date_limit and self.date_filter: