]> git.parisson.com Git - telecaster-client.git/commitdiff
fix dir at stop
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Fri, 4 Apr 2025 10:27:12 +0000 (12:27 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Fri, 4 Apr 2025 10:27:12 +0000 (12:27 +0200)
telecaster/models.py

index 2df21d6e8c810611883191f4642701b6e782e722..c9069ef2aa29afd73ac2636ef137ae1f5bf6ed0e 100644 (file)
@@ -209,9 +209,11 @@ class Station(Model):
             os.system('kill -9 '+str(self.pid))
         else:
             if self.format == 'mp3':
-                os.system('touch "' + self.record_dir + os.sep + 'mp3.tofix"')
+                if os.path.exists(self.record_dir):
+                    os.system('touch "' + self.record_dir + os.sep + 'mp3.tofix"')
             elif self.format == 'webm':
-                os.system('touch "' + self.record_dir + os.sep + 'webm.tofix"')
+                if os.path.exists(self.record_dir):
+                    os.system('touch "' + self.record_dir + os.sep + 'webm.tofix"')
             try:
                 os.system('kill -9 '+str(self.pid))
             except: