+@permission_required('archive.change_audiobook')
+def file_managed(request, id):
+ audiobook = get_object_or_404(models.Audiobook, id=id)
+
+ if request.POST:
+ form = AudiobookForm(request.POST, instance=audiobook)
+ if form.is_valid():
+ try:
+ form.save()
+ except IOError:
+ raise Http404
+
+ division = 'published' if audiobook.published() else 'unpublished'
+ path = audiobook.source_file.path[len(settings.FILES_PATH):].lstrip('/')
+
+ # for tags update
+ tags = mutagen.File(audiobook.source_file.path)
+ if not tags:
+ tags = {}
+ form = AudiobookForm(instance=audiobook)
+
+ return render(request, "archive/file_managed.html", locals())