make mobi wasn't setting provider

pull/46/head
eric 2017-12-14 14:19:20 -05:00
parent 3ae537132e
commit 15d281c988
2 changed files with 6 additions and 2 deletions

View File

@ -23,11 +23,14 @@ class Command(BaseCommand):
ebf = ebook.get_archive_ebf() ebf = ebook.get_archive_ebf()
if ebf: if ebf:
try: try:
print 'making mobi for {}'.format(work.title)
if ebf.make_mobi(): if ebf.make_mobi():
print 'made mobi for {}'.format(ebf.edition.work.title) print 'made mobi'
i = i + 1 i = i + 1
break break
else:
print 'failed to make mobi'
except: except:
pass print 'failed to make mobi'
if i >= max: if i >= max:
break break

View File

@ -1089,6 +1089,7 @@ class EbookFile(models.Model):
new_ebook = Ebook.objects.create( new_ebook = Ebook.objects.create(
edition=self.edition, edition=self.edition,
format='mobi', format='mobi',
provider='Unglue.it',
url=new_mobi_ebf.file.url, url=new_mobi_ebf.file.url,
rights=self.ebook.rights, rights=self.ebook.rights,
version_label=self.ebook.version_label, version_label=self.ebook.version_label,