X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/42d519535bd4445ef0fa8279876bc6eb9560ad6b..7caeba940138a780a93417f97844d2ad2ae090b2:/apps/archive/tasks.py?ds=inline diff --git a/apps/archive/tasks.py b/apps/archive/tasks.py index e257da0..27b6d00 100755 --- a/apps/archive/tasks.py +++ b/apps/archive/tasks.py @@ -47,10 +47,14 @@ class AudioFormatTask(Task): @classmethod def save(cls, audiobook, file_name): - getattr(audiobook, "%s_file" % cls.ext).save( + field = "%s_file" % cls.ext + getattr(audiobook, field).save( "%d.%s" % (audiobook.pk, cls.ext), - ExistingFile(file_name) + ExistingFile(file_name), + save=False ) + Audiobook.objects.filter(pk=audiobook.pk).update( + **{field: getattr(audiobook, field)}) @classmethod def published(cls, audiobook):