mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-30 05:28:20 +00:00
Changed mix to not calculate duration before file is available
This commit is contained in:
@@ -259,3 +259,7 @@ import mimetypes
|
||||
mimetypes.add_type("text/xml", ".plist", False)
|
||||
|
||||
HTML_MINIFY = not localsettings.DEBUG
|
||||
|
||||
if DEBUG:
|
||||
import mimetypes
|
||||
mimetypes.add_type("image/png", ".png", True)
|
||||
|
||||
@@ -127,3 +127,5 @@ class MixResource(BackboneCompatibleResource):
|
||||
bundle.data['liked'] = bundle.obj.is_liked(bundle.request.user)
|
||||
bundle.data['favourited'] = bundle.obj.is_favourited(bundle.request.user)
|
||||
return bundle
|
||||
|
||||
|
||||
|
||||
0
spa/migrations/0006_auto__chg_field_userprofile_user.py
Executable file → Normal file
0
spa/migrations/0006_auto__chg_field_userprofile_user.py
Executable file → Normal file
@@ -2,7 +2,6 @@ import os
|
||||
import rfc822
|
||||
from datetime import datetime
|
||||
import urlparse
|
||||
from django.template.defaultfilters import slugify
|
||||
|
||||
from sorl.thumbnail import get_thumbnail
|
||||
from django.contrib.sites.models import Site
|
||||
@@ -10,7 +9,6 @@ from django.db import models
|
||||
from django.db.models import Count
|
||||
|
||||
from core.utils import url
|
||||
from core.utils.audio.mp3 import mp3_length
|
||||
from core.utils.url import unique_slugify
|
||||
from spa.models.genre import Genre
|
||||
from spa.models.mixplay import MixPlay
|
||||
@@ -69,8 +67,6 @@ class Mix(_BaseModel):
|
||||
if os.path.isfile(self.get_waveform_path()):
|
||||
self.waveform_generated = True
|
||||
|
||||
self.duration = mp3_length(self.get_absolute_path())
|
||||
|
||||
self.clean_image('mix_image', Mix)
|
||||
super(Mix, self).save(force_insert, force_update, using)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from kombu import Connection
|
||||
from kombu.entity import Exchange
|
||||
from django.contrib.auth.models import User
|
||||
from south import signals
|
||||
from core.utils.audio.mp3 import mp3_length
|
||||
|
||||
from dss import localsettings, settings
|
||||
from spa.models import _Activity
|
||||
@@ -24,6 +25,7 @@ def waveform_generated_callback(sender, **kwargs):
|
||||
mix = Mix.objects.get(uid=uid)
|
||||
if mix is not None:
|
||||
mix.waveform_generated = True
|
||||
mix.duration = mp3_length(mix.get_absolute_path())
|
||||
mix.save()
|
||||
except ObjectDoesNotExist:
|
||||
pass
|
||||
|
||||
0
static/js/libs/ape/apeClientJS.js
Executable file → Normal file
0
static/js/libs/ape/apeClientJS.js
Executable file → Normal file
0
static/js/libs/ape/apeClientMoo.js
Executable file → Normal file
0
static/js/libs/ape/apeClientMoo.js
Executable file → Normal file
0
static/js/libs/ape/apeCore.js
Executable file → Normal file
0
static/js/libs/ape/apeCore.js
Executable file → Normal file
0
static/js/libs/ape/apeCoreSession.js
Executable file → Normal file
0
static/js/libs/ape/apeCoreSession.js
Executable file → Normal file
0
static/js/libs/backbone/backbone.marionette.js
Executable file → Normal file
0
static/js/libs/backbone/backbone.marionette.js
Executable file → Normal file
0
static/js/libs/backbone/backbone.syphon.js
Executable file → Normal file
0
static/js/libs/backbone/backbone.syphon.js
Executable file → Normal file
Reference in New Issue
Block a user