1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-28 13:57:42 +00:00

Upload pdf fixes:

Handle no title
Handle no author
Fix import of more than one language
Add missing pdf upload publisher handling
This commit is contained in:
Ozzie Isaacs
2021-03-17 19:06:51 +01:00
parent 2be7b6480a
commit fcf9e7a1ef
9 changed files with 148 additions and 39 deletions

View File

@@ -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)