mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-22 11:07:39 +00:00
Fix for #2363 (Handle empty response from lubimyczytac metadata provider)
This commit is contained in:
@@ -113,17 +113,18 @@ class LubimyCzytac(Metadata):
|
|||||||
) -> Optional[List[MetaRecord]]:
|
) -> Optional[List[MetaRecord]]:
|
||||||
if self.active:
|
if self.active:
|
||||||
result = requests.get(self._prepare_query(title=query))
|
result = requests.get(self._prepare_query(title=query))
|
||||||
root = fromstring(result.text)
|
if result.text:
|
||||||
lc_parser = LubimyCzytacParser(root=root, metadata=self)
|
root = fromstring(result.text)
|
||||||
matches = lc_parser.parse_search_results()
|
lc_parser = LubimyCzytacParser(root=root, metadata=self)
|
||||||
if matches:
|
matches = lc_parser.parse_search_results()
|
||||||
with ThreadPool(processes=10) as pool:
|
if matches:
|
||||||
final_matches = pool.starmap(
|
with ThreadPool(processes=10) as pool:
|
||||||
lc_parser.parse_single_book,
|
final_matches = pool.starmap(
|
||||||
[(match, generic_cover, locale) for match in matches],
|
lc_parser.parse_single_book,
|
||||||
)
|
[(match, generic_cover, locale) for match in matches],
|
||||||
return final_matches
|
)
|
||||||
return matches
|
return final_matches
|
||||||
|
return matches
|
||||||
|
|
||||||
def _prepare_query(self, title: str) -> str:
|
def _prepare_query(self, title: str) -> str:
|
||||||
query = ""
|
query = ""
|
||||||
|
Reference in New Issue
Block a user