+ def media_url(self, format_):
+ media = self.get_media(format_)
+ if media:
+ if self.preview:
+ return reverse('embargo_link', kwargs={'slug': self.slug, 'format_': format_})
+ else:
+ return media.url
+ else:
+ return None
+
+ def html_url(self):
+ return self.media_url('html')
+
+ def pdf_url(self):
+ return self.media_url('pdf')
+
+ def epub_url(self):
+ return self.media_url('epub')
+
+ def mobi_url(self):
+ return self.media_url('mobi')
+
+ def txt_url(self):
+ return self.media_url('txt')
+
+ def fb2_url(self):
+ return self.media_url('fb2')
+
+ def xml_url(self):
+ return self.media_url('xml')
+