From cb7727900c4e96b90480bc70ea71d5042401aac0 Mon Sep 17 00:00:00 2001 From: dickreckard Date: Mon, 7 Sep 2020 13:30:03 +0200 Subject: [PATCH 1/8] Update uploader.py default cover changed from none to pdf_preview when metadata parsing fails --- cps/uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/uploader.py b/cps/uploader.py index 2cb982b9..863d094d 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -106,7 +106,7 @@ def default_meta(tmp_file_path, original_file_name, original_file_extension): extension=original_file_extension, title=original_file_name, author=_(u'Unknown'), - cover=None, + cover=pdf_preview(tmp_file_path, original_file_name), description="", tags="", series="", From 23fe79c6182b7f08eb8769ed7c8c1203c61ef63a Mon Sep 17 00:00:00 2001 From: dickreckard Date: Fri, 11 Sep 2020 03:42:19 +0200 Subject: [PATCH 2/8] Update uploader.py --- cps/uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/uploader.py b/cps/uploader.py index 863d094d..dd37bf62 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -135,7 +135,7 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): author=' & '.join(split_authors([author])), cover=pdf_preview(tmp_file_path, original_file_name), description=subject, - tags="", + tags=doc_info['/Keywords'], series="", series_id="", languages="") From 22466d6b98fabf0046245c68b7db2bcf8c45991f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2020 10:08:55 +0000 Subject: [PATCH 3/8] xmp data processing added to the uploader --- cps/uploader.py | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/cps/uploader.py b/cps/uploader.py index dd37bf62..3747b24f 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -119,10 +119,36 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): if use_pdf_meta: with open(tmp_file_path, 'rb') as f: doc_info = PdfFileReader(f).getDocumentInfo() - if doc_info: - author = doc_info.author if doc_info.author else u'Unknown' - title = doc_info.title if doc_info.title else original_file_name - subject = doc_info.subject + xmp_info = PdfFileReader(f).getXmpMetadata() + if xmp_info: + xmp_author = xmp_info.dc_creator + if xmp_info.dc_title: + xmp_title = xmp_info.dc_title['x-default'] + else: + xmp_title = '' + if xmp_info.dc_description: + xmp_description = xmp_info.dc_description['x-default'] + else: + xmp_description = '' + if xmp_info.dc_subject: + xmp_tags = ', '.join(xmp_info.dc_subject) + else: + xmp_tags = '' + if xmp_info.dc_language: + xmp_language = ', '.join(xmp_info.dc_language) + else: + xmp_language='' + if xmp_info.dc_publisher: + xmp_publisher = ', '.join(xmp_info.dc_publisher) + else: + xmp_publisher='' + if xmp_info or doc_info: + author = xmp_author or split_authors([doc_info.author]) or u'Unknown' + title = xmp_title or doc_info.title or original_file_name + subject = xmp_description or doc_info.subject + publisher = xmp_publisher + tags = xmp_tags or doc_info['/Keywords'] + language = xmp_language else: author = u'Unknown' title = original_file_name @@ -132,13 +158,13 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): file_path=tmp_file_path, extension=original_file_extension, title=title, - author=' & '.join(split_authors([author])), + author=' & '.join(author), cover=pdf_preview(tmp_file_path, original_file_name), description=subject, - tags=doc_info['/Keywords'], + tags=tags, series="", series_id="", - languages="") + languages=language) def pdf_preview(tmp_file_path, tmp_dir): From 65929c02bc2150ad932fc61366cf5ca4b771c208 Mon Sep 17 00:00:00 2001 From: dickreckard Date: Fri, 11 Sep 2020 10:49:45 +0000 Subject: [PATCH 4/8] isolanguage parsing of xmp data --- cps/uploader.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cps/uploader.py b/cps/uploader.py index 3747b24f..3f2b986a 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -22,7 +22,7 @@ import hashlib from tempfile import gettempdir from flask_babel import gettext as _ -from . import logger, comic +from . import logger, comic, isoLanguages from .constants import BookMeta from .helper import split_authors @@ -118,8 +118,9 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): doc_info = None if use_pdf_meta: with open(tmp_file_path, 'rb') as f: - doc_info = PdfFileReader(f).getDocumentInfo() - xmp_info = PdfFileReader(f).getXmpMetadata() + pdf_file = PdfFileReader(f) + doc_info = pdf_file.getDocumentInfo() + xmp_info = pdf_file.getXmpMetadata() if xmp_info: xmp_author = xmp_info.dc_creator if xmp_info.dc_title: @@ -130,25 +131,26 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): xmp_description = xmp_info.dc_description['x-default'] else: xmp_description = '' - if xmp_info.dc_subject: - xmp_tags = ', '.join(xmp_info.dc_subject) - else: - xmp_tags = '' - if xmp_info.dc_language: - xmp_language = ', '.join(xmp_info.dc_language) - else: - xmp_language='' - if xmp_info.dc_publisher: - xmp_publisher = ', '.join(xmp_info.dc_publisher) - else: - xmp_publisher='' + xmp_tags = ', '.join(xmp_info.dc_subject) + xmp_language = xmp_info.dc_language[0] + xmp_publisher = ', '.join(xmp_info.dc_publisher) + if xmp_info or doc_info: author = xmp_author or split_authors([doc_info.author]) or u'Unknown' title = xmp_title or doc_info.title or original_file_name subject = xmp_description or doc_info.subject publisher = xmp_publisher tags = xmp_tags or doc_info['/Keywords'] - language = xmp_language + if xmp_language : + lang = xmp_language.split('-', 1)[0].lower() + if len(lang) == 2: + language = isoLanguages.get(part1=lang).name + elif len(lang) == 3: + language = isoLanguages.get(part3=lang).name + else: + language = '' + else: + language = '' else: author = u'Unknown' title = original_file_name From 8abfaf0ffd28cbb4d4e33bcf854e7aa2efda86fb Mon Sep 17 00:00:00 2001 From: rra Date: Tue, 16 Mar 2021 17:53:33 +0100 Subject: [PATCH 5/8] Parse XMP metadata in separate function, add exception, try multiple metadata formats --- cps/uploader.py | 97 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 31 deletions(-) diff --git a/cps/uploader.py b/cps/uploader.py index 246b3bb9..a50e22ac 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -22,11 +22,10 @@ import hashlib from tempfile import gettempdir from flask_babel import gettext as _ -from . import logger, comic, isoLanguages +from . import logger, comic, isoLanguages, get_locale from .constants import BookMeta from .helper import split_authors - log = logger.create() @@ -82,7 +81,7 @@ def process(tmp_file_path, original_file_name, original_file_extension, rarExecu original_file_name, original_file_extension, rarExecutable) - except Exception as ex: + except Exception as ex: log.warning('cannot parse metadata, using default: %s', ex) if meta and meta.title.strip() and meta.author.strip(): @@ -106,59 +105,95 @@ def default_meta(tmp_file_path, original_file_name, original_file_extension): languages="") -def pdf_meta(tmp_file_path, original_file_name, original_file_extension): - doc_info = None - if use_pdf_meta: - with open(tmp_file_path, 'rb') as f: - pdf_file = PdfFileReader(f) - doc_info = pdf_file.getDocumentInfo() - xmp_info = pdf_file.getXmpMetadata() +def parse_xmp(pdf_file): + """ + Parse XMP Metadata and prepare for BookMeta object + """ + try: + xmp_info = pdf_file.getXmpMetadata() + except Exception as e: + log.debug('Can not read XMP metadata', e) + return None + if xmp_info: - xmp_author = xmp_info.dc_creator + try: + xmp_author = xmp_info.dc_creator # list + except: + xmp_author = ['Unknown'] + if xmp_info.dc_title: xmp_title = xmp_info.dc_title['x-default'] else: xmp_title = '' + if xmp_info.dc_description: xmp_description = xmp_info.dc_description['x-default'] else: xmp_description = '' + + languages = [] + for i in xmp_info.dc_language: + #calibre-web currently only takes one language. + languages.append(isoLanguages.get_lang3(i)) + xmp_tags = ', '.join(xmp_info.dc_subject) - xmp_language = xmp_info.dc_language[0] xmp_publisher = ', '.join(xmp_info.dc_publisher) + xmp_languages = xmp_info.dc_language + + return {'author': xmp_author, + 'title': xmp_title, + 'subject': xmp_description, + 'tags': xmp_tags, 'languages': languages, + 'publisher': xmp_publisher + } + + +def pdf_meta(tmp_file_path, original_file_name, original_file_extension): + doc_info = None + xmp_info = None + + if use_pdf_meta: + with open(tmp_file_path, 'rb') as f: + pdf_file = PdfFileReader(f) + doc_info = pdf_file.getDocumentInfo() + xmp_info = parse_xmp(pdf_file) + + if xmp_info: + author = ' & '.join(split_authors(xmp_info['author'])) + title = xmp_info['title'] + subject = xmp_info['subject'] + tags = xmp_info['tags'] + languages = xmp_info['languages'] + publisher = xmp_info['publisher'] + + elif doc_info: + author = ' & '.join(split_authors([doc_info.author])) + title = doc_info.title + subject = doc_info.subject + tags = doc_info['/Keywords'] + languages = "" + publisher = "" - if xmp_info or doc_info: - author = xmp_author or split_authors([doc_info.author]) or u'Unknown' - title = xmp_title or doc_info.title or original_file_name - subject = xmp_description or doc_info.subject - publisher = xmp_publisher - tags = xmp_tags or doc_info['/Keywords'] - if xmp_language : - lang = xmp_language.split('-', 1)[0].lower() - if len(lang) == 2: - language = isoLanguages.get(part1=lang).name - elif len(lang) == 3: - language = isoLanguages.get(part3=lang).name - else: - language = '' - else: - language = '' else: - author = u'Unknown' + author= u'Unknown' title = original_file_name subject = "" + tags = "" + languages = "" + publisher = "" return BookMeta( file_path=tmp_file_path, extension=original_file_extension, title=title, - author=' & '.join(author), + author=author, cover=pdf_preview(tmp_file_path, original_file_name), description=subject, tags=tags, series="", series_id="", - languages=language) + languages=', '.join(languages) + ) def pdf_preview(tmp_file_path, tmp_dir): From fcf9e7a1ef1e9dfd83f5846fc7eb2b26ad1cb609 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Wed, 17 Mar 2021 19:06:51 +0100 Subject: [PATCH 6/8] Upload pdf fixes: Handle no title Handle no author Fix import of more than one language Add missing pdf upload publisher handling --- cps/comic.py | 6 +- cps/constants.py | 2 +- cps/editbooks.py | 11 ++-- cps/epub.py | 3 +- cps/fb2.py | 3 +- cps/isoLanguages.py | 14 +++-- cps/uploader.py | 132 ++++++++++++++++++++++++++++++++++++++------ requirements.txt | 2 +- setup.cfg | 14 ++--- 9 files changed, 148 insertions(+), 39 deletions(-) diff --git a/cps/comic.py b/cps/comic.py index c2b30197..c1f1fd63 100644 --- a/cps/comic.py +++ b/cps/comic.py @@ -154,7 +154,8 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r tags="", series=loadedMetadata.series or "", series_id=loadedMetadata.issue or "", - languages=loadedMetadata.language) + languages=loadedMetadata.language, + publisher="") return BookMeta( file_path=tmp_file_path, @@ -166,4 +167,5 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r tags="", series="", series_id="", - languages="") + languages="", + publisher="") diff --git a/cps/constants.py b/cps/constants.py index ac1157ef..2c00d434 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -130,7 +130,7 @@ def selected_roles(dictionary): # :rtype: BookMeta BookMeta = namedtuple('BookMeta', 'file_path, extension, title, author, cover, description, tags, series, ' - 'series_id, languages') + 'series_id, languages, publisher') STABLE_VERSION = {'version': '0.6.12 Beta'} diff --git a/cps/editbooks.py b/cps/editbooks.py index 42bda734..28cad5c5 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -444,10 +444,10 @@ def edit_book_languages(languages, book, upload=False): return modify_database_object(input_l, book.languages, db.Languages, calibre_db.session, 'languages') -def edit_book_publisher(to_save, book): +def edit_book_publisher(publishers, book): changed = False - if to_save["publisher"]: - publisher = to_save["publisher"].rstrip().strip() + if publishers: + publisher = publishers.rstrip().strip() if len(book.publishers) == 0 or (len(book.publishers) > 0 and publisher != book.publishers[0].name): changed |= modify_database_object([publisher], book.publishers, db.Publishers, calibre_db.session, 'publisher') @@ -740,7 +740,7 @@ def edit_book(book_id): book.pubdate = db.Books.DEFAULT_PUBDATE # handle book publisher - modif_date |= edit_book_publisher(to_save, book) + modif_date |= edit_book_publisher(to_save['publisher'], book) # handle book languages modif_date |= edit_book_languages(to_save['languages'], book) @@ -867,6 +867,9 @@ def create_book_on_upload(modif_date, meta): # handle tags modif_date |= edit_book_tags(meta.tags, db_book) + # handle publisher + modif_date |= edit_book_publisher(meta.publisher, db_book) + # handle series modif_date |= edit_book_series(meta.series, db_book) diff --git a/cps/epub.py b/cps/epub.py index 583e4eda..5833c2aa 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -142,4 +142,5 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): tags=epub_metadata['subject'].encode('utf-8').decode('utf-8'), series=epub_metadata['series'].encode('utf-8').decode('utf-8'), series_id=epub_metadata['series_id'].encode('utf-8').decode('utf-8'), - languages=epub_metadata['language']) + languages=epub_metadata['language'], + publisher="") diff --git a/cps/fb2.py b/cps/fb2.py index bdb3d1d5..59df19ba 100644 --- a/cps/fb2.py +++ b/cps/fb2.py @@ -77,4 +77,5 @@ def get_fb2_info(tmp_file_path, original_file_extension): tags="", series="", series_id="", - languages="") + languages="", + publisher="") diff --git a/cps/isoLanguages.py b/cps/isoLanguages.py index 896d4faf..08bdf956 100644 --- a/cps/isoLanguages.py +++ b/cps/isoLanguages.py @@ -57,27 +57,29 @@ def get_language_name(locale, lang_code): def get_language_codes(locale, language_names, remainder=None): language_names = set(x.strip().lower() for x in language_names if x) - languages = list() + lang = list() for k, v in get_language_names(locale).items(): v = v.lower() if v in language_names: - languages.append(k) + lang.append(k) language_names.remove(v) if remainder is not None: remainder.extend(language_names) - return languages + return lang + def get_valid_language_codes(locale, language_names, remainder=None): - languages = list() + lang = list() if "" in language_names: language_names.remove("") for k, __ in get_language_names(locale).items(): if k in language_names: - languages.append(k) + lang.append(k) language_names.remove(k) if remainder is not None and len(language_names): remainder.extend(language_names) - return languages + return lang + def get_lang3(lang): try: diff --git a/cps/uploader.py b/cps/uploader.py index 5fd445c6..b86ce4dd 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -44,12 +44,17 @@ except (ImportError, RuntimeError) as e: use_generic_pdf_cover = True try: - from PyPDF2 import PdfFileReader - from PyPDF2 import __version__ as PyPdfVersion + from PyPDF3 import PdfFileReader + from PyPDF3 import __version__ as PyPdfVersion use_pdf_meta = True -except ImportError as e: - log.debug('Cannot import PyPDF2, extracting pdf metadata will not work: %s', e) - use_pdf_meta = False +except ImportError as ex: + try: + from PyPDF2 import PdfFileReader + from PyPDF2 import __version__ as PyPdfVersion + use_pdf_meta = True + except ImportError as e: + log.debug('Cannot import PyPDF3/PyPDF2, extracting pdf metadata will not work: %s / %s', e) + use_pdf_meta = False try: from . import epub @@ -102,7 +107,98 @@ def default_meta(tmp_file_path, original_file_name, original_file_extension): tags="", series="", series_id="", - languages="") + languages="", + publisher="") + + +def parse_xmp(pdf_file): + """ + Parse XMP Metadata and prepare for BookMeta object + """ + try: + xmp_info = pdf_file.getXmpMetadata() + except Exception as e: + log.debug('Can not read XMP metadata', e) + return None + + if xmp_info: + try: + xmp_author = xmp_info.dc_creator # list + except AttributeError: + xmp_author = [''] + + if xmp_info.dc_title: + xmp_title = xmp_info.dc_title['x-default'] + else: + xmp_title = '' + + if xmp_info.dc_description: + xmp_description = xmp_info.dc_description['x-default'] + else: + xmp_description = '' + + languages = [] + try: + for i in xmp_info.dc_language: + #calibre-web currently only takes one language. + languages.append(isoLanguages.get_lang3(i)) + except: + languages.append('') + + xmp_tags = ', '.join(xmp_info.dc_subject) + xmp_publisher = ', '.join(xmp_info.dc_publisher) + + return {'author': xmp_author, + 'title': xmp_title, + 'subject': xmp_description, + 'tags': xmp_tags, 'languages': languages, + 'publisher': xmp_publisher + } + + +def parse_xmp(pdf_file): + """ + Parse XMP Metadata and prepare for BookMeta object + """ + try: + xmp_info = pdf_file.getXmpMetadata() + except Exception as e: + log.debug('Can not read XMP metadata', e) + return None + + if xmp_info: + try: + xmp_author = xmp_info.dc_creator # list + except: + xmp_author = [''] + + if xmp_info.dc_title: + xmp_title = xmp_info.dc_title['x-default'] + else: + xmp_title = '' + + if xmp_info.dc_description: + xmp_description = xmp_info.dc_description['x-default'] + else: + xmp_description = '' + + languages = [] + try: + for i in xmp_info.dc_language: + languages.append(isoLanguages.get_lang3(i)) + except AttributeError: + languages= [""] + + xmp_tags = ', '.join(xmp_info.dc_subject) + xmp_publisher = ', '.join(xmp_info.dc_publisher) + + return {'author': xmp_author, + 'title': xmp_title, + 'subject': xmp_description, + 'tags': xmp_tags, + 'languages': languages, + 'publisher': xmp_publisher + } def parse_xmp(pdf_file): @@ -154,6 +250,8 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): if use_pdf_meta: with open(tmp_file_path, 'rb') as f: + languages = [""] + publisher = "" pdf_file = PdfFileReader(f) doc_info = pdf_file.getDocumentInfo() xmp_info = parse_xmp(pdf_file) @@ -166,20 +264,22 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): languages = xmp_info['languages'] publisher = xmp_info['publisher'] - elif doc_info: - author = ' & '.join(split_authors([doc_info.author])) - title = doc_info.title - subject = doc_info.subject - tags = doc_info['/Keywords'] - languages = "" - publisher = "" + if doc_info: + if author == '': + author = ' & '.join(split_authors([doc_info.author])) if doc_info.author else u'Unknown' + if title == '': + title = doc_info.title if doc_info.title else original_file_name + if subject == '': + subject = doc_info.subject + if tags == '' and '/Keywords' in doc_info: + tags = doc_info['/Keywords'] else: author= u'Unknown' title = original_file_name subject = "" tags = "" - languages = "" + languages = [""] publisher = "" return BookMeta( @@ -192,8 +292,8 @@ def pdf_meta(tmp_file_path, original_file_name, original_file_extension): tags=tags, series="", series_id="", - languages=', '.join(languages) - ) + languages=','.join(languages), + publisher=publisher) def pdf_preview(tmp_file_path, tmp_dir): diff --git a/requirements.txt b/requirements.txt index 94dc7f3a..04aaa000 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ singledispatch>=3.4.0.0,<3.5.0.0 backports_abc>=0.4 Flask>=1.0.2,<1.2.0 iso-639>=0.4.5,<0.5.0 -PyPDF2>=1.26.0,<1.27.0 +PyPDF3>=1.0.0,<1.0.4 pytz>=2016.10 requests>=2.11.1,<2.25.0 SQLAlchemy>=1.3.0,<1.4.0 diff --git a/setup.cfg b/setup.cfg index 88624195..89e0f598 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,7 +42,7 @@ install_requires = backports_abc>=0.4 Flask>=1.0.2,<1.2.0 iso-639>=0.4.5,<0.5.0 - PyPDF2>=1.26.0,<1.27.0 + PyPDF3>=1.0.0,<1.0.4 pytz>=2016.10 requests>=2.11.1,<2.25.0 SQLAlchemy>=1.3.0,<1.4.0 @@ -52,9 +52,9 @@ install_requires = [options.extras_require] gdrive = - google-api-python-client>=1.7.11,<1.8.0 - gevent>=1.2.1,<20.6.0 - greenlet>=0.4.12,<0.4.17 + google-api-python-client>=1.7.11,<1.13.0 + gevent>20.6.0,<21.2.0 + greenlet>=0.4.17,<1.1.0 httplib2>=0.9.2,<0.18.0 oauth2client>=4.0.0,<4.1.4 uritemplate>=3.0.0,<3.1.0 @@ -68,16 +68,16 @@ goodreads = goodreads>=0.3.2,<0.4.0 python-Levenshtein>=0.12.0,<0.13.0 ldap = - python-ldap>=3.0.0,<3.3.0 + python-ldap>=3.0.0,<3.4.0 Flask-SimpleLDAP>=1.4.0,<1.5.0 oauth = Flask-Dance>=1.4.0,<3.1.0 SQLAlchemy-Utils>=0.33.5,<0.37.0 metadata = - lxml>=3.8.0,<4.6.0 + lxml>=3.8.0,<4.7.0 rarfile>=2.7 comics = - natsort>=2.2.0 + natsort>=2.2.0,<7.1.0 comicapi>= 2.1.3,<2.2.0 kobo = jsonschema>=3.2.0,<3.3.0 From 8f5c649d0f746e2a20e7a3cffb238ec6d20b1c5e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Thu, 18 Mar 2021 18:56:00 +0100 Subject: [PATCH 7/8] Updated dependency comicapi (removed pypdf2) Updated dependency pyPDF2 ->pyPDF3 Fixed broken updater in case of http error Bugfixes from testrun Bugfix load cover for BasicMetadata --- cps/updater.py | 1 + cps/uploader.py | 2 +- optional-requirements.txt | 2 +- test/Calibre-Web TestSummary_Linux.html | 1475 +++++------------------ 4 files changed, 328 insertions(+), 1152 deletions(-) diff --git a/cps/updater.py b/cps/updater.py index 52fd2017..837b72be 100644 --- a/cps/updater.py +++ b/cps/updater.py @@ -325,6 +325,7 @@ class Updater(threading.Thread): @staticmethod def _load_nightly_data(repository_url, commit, status): + update_data = dict() try: headers = {'Accept': 'application/vnd.github.v3+json'} r = requests.get(repository_url + '/git/commits/' + commit['object']['sha'], diff --git a/cps/uploader.py b/cps/uploader.py index b86ce4dd..a4fe8453 100644 --- a/cps/uploader.py +++ b/cps/uploader.py @@ -102,7 +102,7 @@ def default_meta(tmp_file_path, original_file_name, original_file_extension): extension=original_file_extension, title=original_file_name, author=_(u'Unknown'), - cover=pdf_preview(tmp_file_path, original_file_name), + cover=None, #pdf_preview(tmp_file_path, original_file_name), description="", tags="", series="", diff --git a/optional-requirements.txt b/optional-requirements.txt index a94bb506..3283777b 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -30,7 +30,7 @@ rarfile>=2.7 # other natsort>=2.2.0,<7.1.0 -comicapi>= 2.1.3,<2.2.0 +comicapi>= 2.2.0,<2.3.0 #Kobo integration jsonschema>=3.2.0,<3.3.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index faa4b57c..c2467a1b 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2021-03-15 10:03:00

+

Start Time: 2021-03-19 06:57:32

-

Stop Time: 2021-03-15 12:18:21

+

Stop Time: 2021-03-19 09:30:30

-

Duration: 1h 47 min

+

Duration: 2h 4 min

@@ -653,11 +653,11 @@ - + TestEditAdditionalBooks 13 - 11 - 1 + 12 + 0 0 1 @@ -676,31 +676,11 @@ - +
TestEditAdditionalBooks - test_delete_book
- -
- FAIL -
- - - - + PASS @@ -822,11 +802,11 @@ AssertionError: False is not true - + TestEditBooks 33 - 31 - 0 + 26 + 5 0 2 @@ -890,47 +870,151 @@ AssertionError: False is not true - +
TestEditBooks - test_edit_custom_float
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_int
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_rating
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_single_select
- PASS + +
+ FAIL +
+ + + + - +
TestEditBooks - test_edit_custom_text
- PASS + +
+ FAIL +
+ + + + @@ -1210,11 +1294,11 @@ AssertionError: False is not true - + TestEditBooksOnGdrive 20 - 19 - 1 + 20 + 0 0 0 @@ -1242,31 +1326,11 @@ AssertionError: False is not true - +
TestEditBooksOnGdrive - test_edit_category
- -
- FAIL -
- - - - + PASS @@ -2358,248 +2422,85 @@ IndexError: list index out of range - - TestEditBooks - 1 - 0 - 0 - 0 + + TestUploadPDF 1 - - Detail - - - - - - - -
TestEditBooks - test_upload_book_pdf
- - -
- SKIP -
- - - - - - - - - - - _ErrorHolder 1 0 0 - 1 0 - Detail + Detail - + -
tearDownClass (test_pdf_metadata)
- - -
- ERROR -
- - - +
TestUploadPDF - test_upload_invalid_pdf
+ PASS - + TestReader 5 + 5 0 0 - 5 0 - Detail + Detail - +
TestReader - test_comic_reader
- -
- ERROR -
- - - - + PASS - +
TestReader - test_epub_reader
- -
- ERROR -
- - - - + PASS - +
TestReader - test_pdf_reader
- -
- ERROR -
- - - - + PASS - +
TestReader - test_sound_listener
- -
- ERROR -
- - - - + PASS - +
TestReader - test_txt_reader
- -
- ERROR -
- - - - + PASS @@ -2613,13 +2514,13 @@ AttributeError: 'bool' object has no attribute 'click' 0 0 - Detail + Detail - +
TestRegister - test_forgot_password
@@ -2628,7 +2529,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_illegal_email
@@ -2637,7 +2538,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_limit_domain
@@ -2646,7 +2547,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_register_no_server
@@ -2655,7 +2556,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_registering_only_email
@@ -2664,7 +2565,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_registering_user
@@ -2673,7 +2574,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_registering_user_fail
@@ -2682,7 +2583,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestRegister - test_user_change_password
@@ -2700,13 +2601,13 @@ AttributeError: 'bool' object has no attribute 'click' 0 1 - Detail + Detail - +
TestShelf - test_add_shelf_from_search
@@ -2715,7 +2616,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_arrange_shelf
@@ -2724,7 +2625,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_delete_book_of_shelf
@@ -2733,7 +2634,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_private_shelf
@@ -2742,7 +2643,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_public_private_shelf
@@ -2751,7 +2652,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_public_shelf
@@ -2760,7 +2661,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_rename_shelf
@@ -2769,7 +2670,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_shelf_action_non_shelf_edit_role
@@ -2778,7 +2679,7 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_shelf_anonymous
@@ -2787,19 +2688,19 @@ AttributeError: 'bool' object has no attribute 'click' - +
TestShelf - test_shelf_database_change
- SKIP + SKIP
-