mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ALlow using both uri: and url: identifiers to create two different links
instead of just one in the Book details panel
This commit is contained in:
parent
980ecc2e12
commit
254b00c864
@ -537,14 +537,13 @@ def urls_from_identifiers(identifiers): # {{{
|
|||||||
if oclc:
|
if oclc:
|
||||||
ans.append(('OCLC', 'oclc', oclc,
|
ans.append(('OCLC', 'oclc', oclc,
|
||||||
'http://www.worldcat.org/oclc/'+oclc))
|
'http://www.worldcat.org/oclc/'+oclc))
|
||||||
url = identifiers.get('uri', None)
|
for x in ('uri', 'url'):
|
||||||
if url is None:
|
url = identifiers.get(x, None)
|
||||||
url = identifiers.get('url', None)
|
if url and url.startswith('http'):
|
||||||
if url and url.startswith('http'):
|
url = url[:8].replace('|', ':') + url[8:].replace('|', ',')
|
||||||
url = url[:8].replace('|', ':') + url[8:].replace('|', ',')
|
parts = urlparse(url)
|
||||||
parts = urlparse(url)
|
name = parts.netloc
|
||||||
name = parts.netloc
|
ans.append((name, x, url, url))
|
||||||
ans.append((name, 'url', url, url))
|
|
||||||
return ans
|
return ans
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user