diff --git a/cps/about.py b/cps/about.py index 2f1d4b43..863ec871 100644 --- a/cps/about.py +++ b/cps/about.py @@ -89,6 +89,7 @@ def stats(): authors = db.session.query(db.Authors).count() categorys = db.session.query(db.Tags).count() series = db.session.query(db.Series).count() - _VERSIONS['ebook converter'] = _(converter.get_version()) + _VERSIONS['ebook converter'] = _(converter.get_calibre_version()) + _VERSIONS['unrar'] = _(converter.get_version()) return render_title_template('stats.html', bookcounter=counter, authorcounter=authors, versions=_VERSIONS, categorycounter=categorys, seriecounter=series, title=_(u"Statistics"), page="stat") diff --git a/cps/converter.py b/cps/converter.py index d3482e5f..b8ad1372 100644 --- a/cps/converter.py +++ b/cps/converter.py @@ -48,10 +48,15 @@ def _get_command_version(path, pattern, argument=None): return _NOT_INSTALLED -def get_version(): +def get_calibre_version(): version = None - if config.config_ebookconverter == 1: - version = _get_command_version(config.config_converterpath, r'Amazon kindlegen\(') - elif config.config_ebookconverter == 2: + if config.config_ebookconverter == 2: + version = _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version') + return version or _NOT_CONFIGURED + + +def get_unrar_version(): + version = None + if config.config_ebookconverter == 2: version = _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version') return version or _NOT_CONFIGURED diff --git a/cps/editbooks.py b/cps/editbooks.py index d66763bf..8d5c9d7e 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -719,7 +719,6 @@ def upload(): os.path.join(filepath, "cover.jpg")) else: has_cover = 1 - move(meta.cover, os.path.join(filepath, "cover.jpg")) # handle authors is_author = db.session.query(db.Authors).filter(db.Authors.name == authr).first() @@ -796,6 +795,10 @@ def upload(): if config.config_use_google_drive: gdriveutils.updateGdriveCalibreFromLocal() error = helper.update_dir_stucture(book.id, config.config_calibre_dir) + + # move cover to final directory, including book id + if has_cover: + move(meta.cover, os.path.join(filepath+ ' ({})'.format(book_id), "cover.jpg")) db.session.commit() if config.config_use_google_drive: gdriveutils.updateGdriveCalibreFromLocal() diff --git a/cps/helper.py b/cps/helper.py index 416921db..0b4c17d2 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -173,14 +173,13 @@ def check_send_to_kindle(entry): bookformats.append({'format': 'Pdf', 'convert': 0, 'text': _('Send %(format)s to Kindle', format='Pdf')}) - if config.config_ebookconverter >= 1: + if config.config_ebookconverter == 2: if 'EPUB' in formats and not 'MOBI' in formats: bookformats.append({'format': 'Mobi', 'convert':1, 'text': _('Convert %(orig)s to %(format)s and send to Kindle', orig='Epub', format='Mobi')}) - if config.config_ebookconverter == 2: if 'AZW3' in formats and not 'MOBI' in formats: bookformats.append({'format': 'Mobi', 'convert': 2, diff --git a/cps/kobo.py b/cps/kobo.py index 2e3c1601..3de410d9 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -949,12 +949,15 @@ def HandleInitRequest(): book_uuid="{ImageId}", width="{width}", height="{height}", + Quality='{Quality}', + isGreyscale='isGreyscale', _external=True)) kobo_resources["image_url_template"] = unquote(url_for("kobo.HandleCoverImageRequest", auth_token=kobo_auth.get_auth_token(), book_uuid="{ImageId}", width="{width}", height="{height}", + isGreyscale='false', _external=True)) diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index f3187011..33d4a5e7 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -329,8 +329,6 @@