mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 21:02:24 +01:00
Support for formats other than MP3 (e.g. FLAC).
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import time
|
||||
from mutagen.mp3 import MP3
|
||||
from mutagen import File
|
||||
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
@ -177,7 +177,7 @@ def upload(request):
|
||||
|
||||
file = request.FILES['file']
|
||||
|
||||
duration = MP3(file).info.length
|
||||
duration = File(file).info.length
|
||||
hash = send_to_bertha(file)
|
||||
song = Song(user=request.user, artist=request.POST.get('artist'), title=request.POST.get('title'), hash=hash, duration=duration)
|
||||
song.save()
|
||||
|
||||
Reference in New Issue
Block a user