make use of settings.CONTENT_TYPES to compute EBOOK_FORMATS
parent
c5b7c20593
commit
bf914a53de
|
@ -937,13 +937,8 @@ def ebooks_in_github_release(repo_owner, repo_name, tag, token=None):
|
||||||
higher rate limit in the GitHub API
|
higher rate limit in the GitHub API
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# epub, mobi, pdf, html, text
|
|
||||||
# map mimetype to file extension
|
# map mimetype to file extension
|
||||||
EBOOK_FORMATS = {'application/epub+zip':'epub',
|
EBOOK_FORMATS = dict([(v,k) for (k,v) in settings.CONTENT_TYPES.items()])
|
||||||
'application/x-mobipocket-ebook': 'mobi',
|
|
||||||
'application/pdf': 'pdf',
|
|
||||||
'text/plain': 'text',
|
|
||||||
'text/html':'html'}
|
|
||||||
|
|
||||||
if token is not None:
|
if token is not None:
|
||||||
gh = login(token=token)
|
gh = login(token=token)
|
||||||
|
|
Loading…
Reference in New Issue