+ custom_pdf_form = forms.CustomPDFForm()
+ return render_to_response('catalogue/book_detail.html', locals(),
+ context_instance=RequestContext(request))
+
+
+def player(request, book):
+ kwargs = models.Book.split_urlid(book)
+ if kwargs is None:
+ raise Http404
+ book = get_object_or_404(models.Book, **kwargs)
+ if not book.has_media('mp3'):
+ raise Http404
+
+ ogg_files = {}
+ for m in book.media.filter(type='ogg').order_by():
+ ogg_files[m.name] = m
+
+ audiobooks = []
+ have_oggs = True