From 49962d34da7d39e9bdf96dbf0bbf185f3a0d3de5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 26 Mar 2016 10:14:31 +0530 Subject: [PATCH] Book details panel: Fix url:file:// identifiers not becoming links --- src/calibre/ebooks/metadata/sources/identify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index 1e033fad72..144ebef76a 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -551,10 +551,10 @@ def urls_from_identifiers(identifiers): # {{{ ans.append((issn, 'issn', issn, 'http://www.worldcat.org/issn/'+issn)) for k, url in identifiers.iteritems(): - if url and re.match(r'ur[il]\d*$', k) is not None and url.startswith('http'): + if url and re.match(r'ur[il]\d*$', k) is not None and url.partition(':')[0].lower() in {'http', 'file', 'https'}: url = url[:8].replace('|', ':') + url[8:].replace('|', ',') parts = urlparse(url) - name = parts.netloc + name = parts.netloc or parts.path ans.append((name, k, url, url)) return ans # }}}