mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 23:33:01 +00:00 
			
		
		
		
	Bugfix allowed formats for comics
Bugfix editing archived books
This commit is contained in:
		| @@ -52,17 +52,14 @@ except (ImportError, LookupError) as e: | |||||||
|         use_rarfile = False |         use_rarfile = False | ||||||
|     use_comic_meta = False |     use_comic_meta = False | ||||||
|  |  | ||||||
| COVER_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.webp', '.bmp'] | NO_JPEG_EXTENSIONS = ['.png', '.webp', '.bmp'] | ||||||
|  | COVER_EXTENSIONS = ['.png', '.webp', '.bmp', '.jpg', '.jpeg'] | ||||||
|  |  | ||||||
| def _cover_processing(tmp_file_name, img, extension): | def _cover_processing(tmp_file_name, img, extension): | ||||||
|     tmp_cover_name = os.path.join(os.path.dirname(tmp_file_name), 'cover.jpg') |     tmp_cover_name = os.path.join(os.path.dirname(tmp_file_name), 'cover.jpg') | ||||||
|     if use_IM: |     if use_IM: | ||||||
|         # convert to jpg because calibre only supports jpg |         # convert to jpg because calibre only supports jpg | ||||||
|         cover_ext = COVER_EXTENSIONS |         if extension in NO_JPEG_EXTENSIONS: | ||||||
|         cover_ext.remove('.jpeg') |  | ||||||
|         cover_ext.remove('.jpg') |  | ||||||
|         if extension in cover_ext: |  | ||||||
|             with Image(filename=tmp_file_name) as imgc: |             with Image(filename=tmp_file_name) as imgc: | ||||||
|                 imgc.format = 'jpeg' |                 imgc.format = 'jpeg' | ||||||
|                 imgc.transform_colorspace('rgb') |                 imgc.transform_colorspace('rgb') | ||||||
|   | |||||||
| @@ -287,7 +287,7 @@ def delete_book(book_id, book_format, jsonResponse): | |||||||
| def render_edit_book(book_id): | def render_edit_book(book_id): | ||||||
|     calibre_db.update_title_sort(config) |     calibre_db.update_title_sort(config) | ||||||
|     cc = calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() |     cc = calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() | ||||||
|     book = calibre_db.get_filtered_book(book_id) |     book = calibre_db.get_filtered_book(book_id, allow_show_archived=True) | ||||||
|     if not book: |     if not book: | ||||||
|         flash(_(u"Error opening eBook. File does not exist or file is not accessible"), category="error") |         flash(_(u"Error opening eBook. File does not exist or file is not accessible"), category="error") | ||||||
|         return redirect(url_for("web.index")) |         return redirect(url_for("web.index")) | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user
	 OzzieIsaacs
					OzzieIsaacs