Browse Source

Display player only if song processing is finished

pull/39/head
Dashie der otter 5 months ago
parent
commit
e544a7be59
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
3 changed files with 11 additions and 2 deletions
  1. 0
    2
      TODO.org
  2. 3
    0
      models.py
  3. 8
    0
      templates/sound/show.jinja2

+ 0
- 2
TODO.org View File

@@ -20,8 +20,6 @@
-> profile UPDATE not handled yet (littleboxes don't handle UPDATE) upstream

~~~~~~~~~ VARIOUS ~~~~~~~~~~~~
Also do not show player until processing is done, and waveform done

Check for sentry in:
- waitress (web)
- celery (workers)

+ 3
- 0
models.py View File

@@ -251,6 +251,9 @@ class Sound(db.Model):
def processing_done(self):
return self.transcode_state == self.TRANSCODE_DONE

def is_ready(self):
return self.processing_done() and self.sound_infos.done_basic


class Album(db.Model):
__tablename__ = "album"

+ 8
- 0
templates/sound/show.jinja2 View File

@@ -48,6 +48,7 @@
{% endif %}

<div class="row">
{% if sound.is_ready() %}
<div class="col-lg-7 col-lg-offset-1">
<div class="row"><div class="col-lg-12">
<div id="waveform"></div>
@@ -77,6 +78,10 @@
</p>
</div></div>
</div>
{% else %}
<div class="col-lg-7 col-lg-offset-1"></div>
{% endif %}

<div class="col-lg-3 offset-1">
<table class="table table-sm table-hoverable">
<tr>
@@ -152,6 +157,7 @@

{% block scripts %}
<script>
{% if sound.is_ready() %}
opts = {
backend: 'MediaElement',
container: '#waveform',
@@ -193,9 +199,11 @@
var duration_time = wavesurfer.getDuration();
$('#player-time-tot').html(secondsTimeSpanToMS(duration_time));
});
{% endif %}

$(function () {
$('[data-toggle="popover"]').popover();
});
</script>
{% endblock %}


Loading…
Cancel
Save