From 52be7610ed69aadaa520b5253b67c1bd47e033e1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 2 Jul 2018 13:51:42 +0530 Subject: [PATCH] Fix commas not working in identifiers that are transformed to URLs via rules. Fixes #1779602 [Identifier with comma](https://bugs.launchpad.net/calibre/+bug/1779602) --- src/calibre/ebooks/metadata/sources/identify.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index dd2d7d92dd..d40002cc80 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -423,8 +423,7 @@ def identify(log, abort, # {{{ if not is_worker_alive(workers): break - if (first_result_at is not None and time.time() - first_result_at > - wait_time): + if (first_result_at is not None and time.time() - first_result_at > wait_time): log.warn('Not waiting any longer for more results. Still running' ' sources:') for worker in workers: @@ -486,8 +485,7 @@ def identify(log, abort, # {{{ result.series_index = dummy.series_index result.relevance_in_source = i result.has_cached_cover_url = ( - plugin.cached_cover_url_is_reliable and - plugin.get_cached_cover_url(result.identifiers) is not None) + plugin.cached_cover_url_is_reliable and plugin.get_cached_cover_url(result.identifiers) is not None) result.identify_plugin = plugin if msprefs['txt_comments']: if plugin.has_html_comments and result.comments: @@ -543,6 +541,7 @@ def urls_from_identifiers(identifiers): # {{{ if rules: formatter = EvalFormatter() for k, val in identifiers.iteritems(): + val = val.replace('|', ',') vals = {'id':quote(val if isinstance(val, bytes) else val.encode('utf-8')).decode('ascii')} items = rules.get(k) or () for name, template in items: