Commit 96d6018e authored by Ozzieisaacs's avatar Ozzieisaacs

Added ability to view comicapi version

Changed required comicapi version
Unified "cannot" and "Cannot" texts
Removed annoying "was already removed" string from log
parent 73ad6dd0
...@@ -36,15 +36,19 @@ log = logger.create() ...@@ -36,15 +36,19 @@ log = logger.create()
try: try:
from comicapi.comicarchive import ComicArchive, MetaDataStyle from comicapi.comicarchive import ComicArchive, MetaDataStyle
use_comic_meta = True use_comic_meta = True
try:
from comicapi import __version__ as comic_version
except (ImportError):
comic_version = ''
except ImportError as e: except ImportError as e:
log.debug('cannot import comicapi, extracting comic metadata will not work: %s', e) log.debug('Cannot import comicapi, extracting comic metadata will not work: %s', e)
import zipfile import zipfile
import tarfile import tarfile
try: try:
import rarfile import rarfile
use_rarfile = True use_rarfile = True
except ImportError as e: except ImportError as e:
log.debug('cannot import rarfile, extracting cover files from rar files will not work: %s', e) log.debug('Cannot import rarfile, extracting cover files from rar files will not work: %s', e)
use_rarfile = False use_rarfile = False
use_comic_meta = False use_comic_meta = False
......
...@@ -280,10 +280,8 @@ def render_edit_book(book_id): ...@@ -280,10 +280,8 @@ def render_edit_book(book_id):
if config.config_converterpath: if config.config_converterpath:
allowed_conversion_formats = constants.EXTENSIONS_CONVERT.copy() allowed_conversion_formats = constants.EXTENSIONS_CONVERT.copy()
for file in book.data: for file in book.data:
try: if file.format.lower() in allowed_conversion_formats:
allowed_conversion_formats.remove(file.format.lower()) allowed_conversion_formats.remove(file.format.lower())
except Exception:
log.warning('%s already removed from list.', file.format.lower())
if kepub_possible: if kepub_possible:
allowed_conversion_formats.append('kepub') allowed_conversion_formats.append('kepub')
return render_title_template('book_edit.html', book=book, authors=author_names, cc=cc, return render_title_template('book_edit.html', book=book, authors=author_names, cc=cc,
......
...@@ -40,7 +40,7 @@ try: ...@@ -40,7 +40,7 @@ try:
from wand.exceptions import PolicyError from wand.exceptions import PolicyError
use_generic_pdf_cover = False use_generic_pdf_cover = False
except (ImportError, RuntimeError) as e: except (ImportError, RuntimeError) as e:
log.debug('cannot import Image, generating pdf covers for pdf uploads will not work: %s', e) log.debug('Cannot import Image, generating pdf covers for pdf uploads will not work: %s', e)
use_generic_pdf_cover = True use_generic_pdf_cover = True
try: try:
...@@ -48,21 +48,21 @@ try: ...@@ -48,21 +48,21 @@ try:
from PyPDF2 import __version__ as PyPdfVersion from PyPDF2 import __version__ as PyPdfVersion
use_pdf_meta = True use_pdf_meta = True
except ImportError as e: except ImportError as e:
log.debug('cannot import PyPDF2, extracting pdf metadata will not work: %s', e) log.debug('Cannot import PyPDF2, extracting pdf metadata will not work: %s', e)
use_pdf_meta = False use_pdf_meta = False
try: try:
from . import epub from . import epub
use_epub_meta = True use_epub_meta = True
except ImportError as e: except ImportError as e:
log.debug('cannot import epub, extracting epub metadata will not work: %s', e) log.debug('Cannot import epub, extracting epub metadata will not work: %s', e)
use_epub_meta = False use_epub_meta = False
try: try:
from . import fb2 from . import fb2
use_fb2_meta = True use_fb2_meta = True
except ImportError as e: except ImportError as e:
log.debug('cannot import fb2, extracting fb2 metadata will not work: %s', e) log.debug('Cannot import fb2, extracting fb2 metadata will not work: %s', e)
use_fb2_meta = False use_fb2_meta = False
try: try:
...@@ -70,7 +70,7 @@ try: ...@@ -70,7 +70,7 @@ try:
from PIL import __version__ as PILversion from PIL import __version__ as PILversion
use_PIL = True use_PIL = True
except ImportError as e: except ImportError as e:
log.debug('cannot import Pillow, using png and webp images as cover will not work: %s', e) log.debug('Cannot import Pillow, using png and webp images as cover will not work: %s', e)
use_PIL = False use_PIL = False
...@@ -179,7 +179,7 @@ def get_versions(): ...@@ -179,7 +179,7 @@ def get_versions():
else: else:
PILVersion = u'not installed' PILVersion = u'not installed'
if comic.use_comic_meta: if comic.use_comic_meta:
ComicVersion = u'installed' ComicVersion = comic.comic_version or u'installed'
else: else:
ComicVersion = u'not installed' ComicVersion = u'not installed'
return {'Image Magick': IVersion, return {'Image Magick': IVersion,
......
...@@ -31,7 +31,7 @@ rarfile>=2.7 ...@@ -31,7 +31,7 @@ rarfile>=2.7
# other # other
natsort>=2.2.0,<7.1.0 natsort>=2.2.0,<7.1.0
git+https://github.com/OzzieIsaacs/comicapi.git@15dff9ce4e1ffed29ba4a2feadfcdb6bed00bcad#egg=comicapi git+https://github.com/OzzieIsaacs/comicapi.git@3e15b950b72724b1b8ca619c36580b5fbaba9784#egg=comicapi
#Kobo integration #Kobo integration
jsonschema>=3.2.0,<3.3.0 jsonschema>=3.2.0,<3.3.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment