-def file_managed(request, id):
- audiobook = get_object_or_404(models.Audiobook, id=id)
- division = 'published' if audiobook.published else 'unpublished'
-
- # for tags update
- tags = mutagen.File(audiobook.source_file.path)
- form = AudiobookForm(instance=audiobook)
-
- return render(request, "archive/file_managed.html", locals())
+ objects = models.Audiobook.objects.exclude(mp3_status=None, ogg_status=None)
+ objects_by_status = {}
+ for o in objects:
+ if o.mp3_status:
+ k = o.mp3_status, o.get_mp3_status_display()
+ objects_by_status.setdefault(k, []).append(o)
+ if o.ogg_status and o.ogg_status != o.mp3_status:
+ k = o.ogg_status, o.get_ogg_status_display()
+ objects_by_status.setdefault(k, []).append(o)
+ status_objects = sorted(objects_by_status.items(), reverse=True)