mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Book details panel: When right clicking to save the cover, replace invalid characters in the suggested filename
This commit is contained in:
parent
994fae5f94
commit
9a452f67b8
@ -13,7 +13,7 @@ from PyQt5.Qt import (
|
||||
QWidget, pyqtProperty, pyqtSignal
|
||||
)
|
||||
|
||||
from calibre import fit_image
|
||||
from calibre import fit_image, sanitize_file_name
|
||||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
from calibre.ebooks.metadata.book.base import Metadata, field_metadata
|
||||
from calibre.ebooks.metadata.book.render import mi_to_html
|
||||
@ -476,7 +476,7 @@ class CoverView(QWidget): # {{{
|
||||
path = choose_save_file(
|
||||
self, 'save-cover-from-book-details', _('Choose cover save location'),
|
||||
filters=[(_('JPEG images'), ['jpg', 'jpeg'])], all_files=False,
|
||||
initial_filename='{}.jpeg'.format(db.field_for('title', book_id, default_value='cover'))
|
||||
initial_filename='{}.jpeg'.format(sanitize_file_name(db.field_for('title', book_id, default_value='cover')))
|
||||
)
|
||||
if path:
|
||||
db.copy_cover_to(book_id, path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user