diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index 219a0e02ca..6e24f4caf7 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -573,8 +573,13 @@ class Amazon(Source): else: url = 'http://www.amazon.%s/dp/%s'%(domain, asin) if url: - idtype = 'amazon' if self.domain == 'com' else 'amazon_'+self.domain + idtype = 'amazon' if domain == 'com' else 'amazon_'+domain return (idtype, asin, url) + + def get_book_url_name(self, idtype, idval, url): + if idtype == 'amazon': + return self.name + return 'A' + idtype.replace('_', '.')[1:] # }}} @property diff --git a/src/calibre/ebooks/metadata/sources/base.py b/src/calibre/ebooks/metadata/sources/base.py index 2206a9ff04..95aa5a3563 100644 --- a/src/calibre/ebooks/metadata/sources/base.py +++ b/src/calibre/ebooks/metadata/sources/base.py @@ -443,6 +443,12 @@ class Source(Plugin): ''' return None + def get_book_url_name(self, idtype, idval, url): + ''' + Return a human readable name from the return value of get_book_url(). + ''' + return self.name + def get_cached_cover_url(self, identifiers): ''' Return cached cover URL for the book identified by diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index be12aae800..5113342b83 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -517,7 +517,7 @@ def urls_from_identifiers(identifiers): # {{{ for plugin in all_metadata_plugins(): try: id_type, id_val, url = plugin.get_book_url(identifiers) - ans.append((plugin.name, id_type, id_val, url)) + ans.append((plugin.get_book_url_name(id_type, id_val, url), id_type, id_val, url)) except: pass isbn = identifiers.get('isbn', None)