Commit 49517623 authored by fred's avatar fred

store uploaded tracks in temporary files as older mutagen requires a real file

parent 9afd969b
......@@ -2,6 +2,7 @@ import csv
import datetime
from cStringIO import StringIO
import os
import tempfile
import mutagen
......@@ -160,8 +161,10 @@ class UploadTracksView(FormView):
missing_metadata = []
metadatas = {}
for f in tracks:
metadata = mutagen.File(f, easy=True)
with tempfile.NamedTemporaryFile(prefix='track-upload') as tmpfile:
metadata = mutagen.File(, easy=True)
if not metadata or not metadata.get('artist') or not metadata.get('title'):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment