Browse Source

Use right path for png waveforms, without double extension

Dashie der otter 1 week ago
parent
commit
f39b4b6893
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
2 changed files with 4 additions and 3 deletions
  1. 2
    1
      models.py
  2. 2
    2
      utils.py

+ 2
- 1
models.py View File

@@ -232,7 +232,8 @@ class Sound(db.Model):
232 232
         return el.total_seconds()
233 233
 
234 234
     def path_waveform(self):
235
-        return os.path.join(self.user.slug, "{0}.png".format(self.filename))
235
+        fname, _ = os.path.splitext(self.filename)
236
+        return os.path.join(self.user.slug, "{0}.png".format(fname))
236 237
 
237 238
     def path_sound(self, orig=False):
238 239
         if self.transcode_needed and self.transcode_state == self.TRANSCODE_DONE and not orig:

+ 2
- 2
utils.py View File

@@ -211,9 +211,9 @@ def create_png_waveform(fn_audio, fn_png):
211 211
         add_log("AUDIOWAVEFORM_PNG", "ERROR", "Filename {0} or binary {1} invalid".format(fn_audio, binary))
212 212
         return None
213 213
 
214
-    fname, _ = splitext(fn_audio)
214
+    fname, _ = splitext(fn_png)
215 215
 
216
-    pngwf = "{0}.png".format(fn_png)
216
+    pngwf = "{0}.png".format(fname)
217 217
 
218 218
     cmd = [
219 219
         binary,

Loading…
Cancel
Save