mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Put the flag back in usbms.driver to force metadata from paths, if that flag is set in the driver. Continue to ignore the flag set in the add-books dialog
This commit is contained in:
parent
c29e881e50
commit
eb73e3a33b
@ -374,8 +374,13 @@ class USBMS(CLI, Device):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def book_from_path(cls, prefix, lpath):
|
def book_from_path(cls, prefix, lpath):
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
mi = cls.metadata_from_path(cls.normalize_path(os.path.join(prefix, lpath)))
|
|
||||||
|
|
||||||
|
if cls.settings().read_metadata or cls.MUST_READ_METADATA:
|
||||||
|
mi = cls.metadata_from_path(cls.normalize_path(os.path.join(prefix, lpath)))
|
||||||
|
else:
|
||||||
|
from calibre.ebooks.metadata.meta import metadata_from_filename
|
||||||
|
mi = metadata_from_filename(cls.normalize_path(os.path.basename(lpath)),
|
||||||
|
cls.build_template_regexp())
|
||||||
if mi is None:
|
if mi is None:
|
||||||
mi = MetaInformation(os.path.splitext(os.path.basename(lpath))[0],
|
mi = MetaInformation(os.path.splitext(os.path.basename(lpath))[0],
|
||||||
[_('Unknown')])
|
[_('Unknown')])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user