]> 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>
Mon, 5 May 2025 16:00:36 +0000 (18:00 +0200)
telecaster/models.py

index 505a61fb3903e74b2c336738144ef084b46c8c11..469d734570b7e4d8720b1ae0c0de0474a9e78dd0 100644 (file)
@@ -210,9 +210,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: