mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Metadata download: If downloaded title or author is all upper case, automatically fix the case
This commit is contained in:
parent
2d7ca736f9
commit
9e764d0dbb
@ -9,6 +9,7 @@ from threading import Thread
|
|||||||
from calibre import prints
|
from calibre import prints
|
||||||
from calibre.utils.config import OptionParser
|
from calibre.utils.config import OptionParser
|
||||||
from calibre.utils.logging import default_log
|
from calibre.utils.logging import default_log
|
||||||
|
from calibre.utils.titlecase import titlecase
|
||||||
from calibre.customize import Plugin
|
from calibre.customize import Plugin
|
||||||
from calibre.ebooks.metadata.covers import check_for_cover
|
from calibre.ebooks.metadata.covers import check_for_cover
|
||||||
|
|
||||||
@ -384,6 +385,16 @@ def search(title=None, author=None, publisher=None, isbn=None, isbndb_key=None,
|
|||||||
if r.pubdate is None:
|
if r.pubdate is None:
|
||||||
r.pubdate = pubdate
|
r.pubdate = pubdate
|
||||||
|
|
||||||
|
def fix_case(x):
|
||||||
|
if x and x.isupper():
|
||||||
|
x = titlecase(x)
|
||||||
|
return x
|
||||||
|
|
||||||
|
for r in results:
|
||||||
|
r.title = fix_case(r.title)
|
||||||
|
if r.authors:
|
||||||
|
r.authors = list(map(fix_case, r.authors))
|
||||||
|
|
||||||
return results, [(x.name, x.exception, x.tb) for x in fetchers]
|
return results, [(x.name, x.exception, x.tb) for x in fetchers]
|
||||||
|
|
||||||
def get_social_metadata(mi, verbose=0):
|
def get_social_metadata(mi, verbose=0):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user