Browse Source

Use right path for png waveforms, without double extension

pull/48/head
Dashie der otter 6 months 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):
return el.total_seconds()

def path_waveform(self):
return os.path.join(self.user.slug, "{0}.png".format(self.filename))
fname, _ = os.path.splitext(self.filename)
return os.path.join(self.user.slug, "{0}.png".format(fname))

def path_sound(self, orig=False):
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):
add_log("AUDIOWAVEFORM_PNG", "ERROR", "Filename {0} or binary {1} invalid".format(fn_audio, binary))
return None

fname, _ = splitext(fn_audio)
fname, _ = splitext(fn_png)

pngwf = "{0}.png".format(fn_png)
pngwf = "{0}.png".format(fname)

cmd = [
binary,

Loading…
Cancel
Save