Forgot to update the format after running FT plugins when importing in the server

This commit is contained in:
Kovid Goyal 2022-10-14 17:26:40 +05:30
parent bdaa9a1ca9
commit a32750b4be
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -101,6 +101,8 @@ def cdb_add_book(ctx, rd, job_id, add_duplicates, filename, library_id):
with open(path, 'rb') as f: with open(path, 'rb') as f:
mi = get_metadata(f, stream_type=os.path.splitext(path)[1][1:], use_libprs_metadata=True) mi = get_metadata(f, stream_type=os.path.splitext(path)[1][1:], use_libprs_metadata=True)
f.seek(0) f.seek(0)
nfmt = os.path.splitext(path)[1]
fmt = nfmt[1:] if nfmt else fmt
ids, duplicates = db.add_books([(mi, {fmt: f})], add_duplicates=add_duplicates) ids, duplicates = db.add_books([(mi, {fmt: f})], add_duplicates=add_duplicates)
ans = {'title': mi.title, 'authors': mi.authors, 'languages': mi.languages, 'filename': filename, 'id': job_id} ans = {'title': mi.title, 'authors': mi.authors, 'languages': mi.languages, 'filename': filename, 'id': job_id}
if ids: if ids: