mirror of
https://gitlab.com/LazyLibrarian/LazyLibrarian.git
synced 2026-02-06 10:47:15 +00:00
Code tidying
This commit is contained in:
parent
439ddd6657
commit
3dd2f0da1f
@ -2283,7 +2283,7 @@ class Api:
|
||||
|
||||
authordata = db.select(f"SELECT AuthorName from authors WHERE {key}='' or {key} is null")
|
||||
api = this_source['api']
|
||||
api.__init__()
|
||||
api = api()
|
||||
for author in authordata:
|
||||
res = api.find_author_id(authorname=author['AuthorName'])
|
||||
if res.get('authorid'):
|
||||
@ -2302,7 +2302,7 @@ class Api:
|
||||
authorname = format_author_name(kwargs['name'], postfix=get_list(CONFIG.get_csv('NAME_POSTFIX')))
|
||||
this_source = lazylibrarian.INFOSOURCES[CONFIG['BOOK_API']]
|
||||
api = this_source['api']
|
||||
api.__init__()
|
||||
api = api()
|
||||
myqueue = Queue()
|
||||
search_api = threading.Thread(target=api.find_results,
|
||||
name=f"API-{this_source['src']}RESULTS",
|
||||
@ -2319,7 +2319,7 @@ class Api:
|
||||
|
||||
this_source = lazylibrarian.INFOSOURCES[CONFIG['BOOK_API']]
|
||||
api = this_source['api']
|
||||
api.__init__()
|
||||
api = api()
|
||||
myqueue = Queue()
|
||||
search_api = threading.Thread(target=api.find_results,
|
||||
name=f"API-{this_source['src']}RESULTS",
|
||||
|
||||
@ -396,12 +396,7 @@ def add_author_to_db(authorname=None, refresh=False, authorid='', addbooks=True,
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
db.upsert("jobs", {"Start": time.time()}, {"Name": thread_name()})
|
||||
authorkeys = []
|
||||
for item in lazylibrarian.INFOSOURCES.keys():
|
||||
this_source = lazylibrarian.INFOSOURCES[item]
|
||||
if this_source['author_key'] and this_source['author_key'] != 'authorid':
|
||||
authorkeys.append(this_source['author_key'])
|
||||
|
||||
authorkeys = author_keys()
|
||||
new_author = True
|
||||
if authorid:
|
||||
cmd = "SELECT * from authors WHERE AuthorID=?"
|
||||
@ -740,11 +735,8 @@ def de_duplicate(authorid):
|
||||
'BookImg', 'BookPages', 'BookLink', 'BookFile', 'BookDate', 'BookLang',
|
||||
'BookAdded', 'WorkPage', 'Manual', 'SeriesDisplay', 'BookLibrary',
|
||||
'AudioFile', 'AudioLibrary', 'WorkID', 'ScanResult', 'OriginalPubDate',
|
||||
'Requester', 'AudioRequester', 'LT_WorkID', 'Narrator']
|
||||
|
||||
for item in lazylibrarian.INFOSOURCES.keys():
|
||||
this_source = lazylibrarian.INFOSOURCES[item]
|
||||
booktable_keys.append(this_source['book_key'])
|
||||
'Requester', 'AudioRequester', 'LT_WorkID', 'Narrator', 'BookID']
|
||||
booktable_keys.extend(book_keys())
|
||||
|
||||
if author:
|
||||
authorname = author['AuthorName']
|
||||
|
||||
Loading…
Reference in New Issue
Block a user