1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-18 06:00:32 +00:00

Fix for #3151 (Invalid amazon link for uk)

This commit is contained in:
Ozzie Isaacs 2024-09-21 12:58:12 +02:00
parent 884f7666fa
commit 2f39e51e1c

View File

@ -114,7 +114,7 @@ class Identifiers(Base):
if format_type == 'amazon': if format_type == 'amazon':
return "Amazon" return "Amazon"
elif format_type.startswith("amazon_"): elif format_type.startswith("amazon_"):
return "Amazon.{0}".format(format_type[7:]) return "Amazon.{0}".format(format_type[7:].lower().replace("uk","co.uk"))
elif format_type == "isbn": elif format_type == "isbn":
return "ISBN" return "ISBN"
elif format_type == "doi": elif format_type == "doi":
@ -149,7 +149,7 @@ class Identifiers(Base):
if format_type == "amazon" or format_type == "asin": if format_type == "amazon" or format_type == "asin":
return "https://amazon.com/dp/{0}".format(self.val) return "https://amazon.com/dp/{0}".format(self.val)
elif format_type.startswith('amazon_'): elif format_type.startswith('amazon_'):
return "https://amazon.{0}/dp/{1}".format(format_type[7:], self.val) return "https://amazon.{0}/dp/{1}".format(format_type[7:].lower().replace("uk","co.uk"), self.val)
elif format_type == "isbn": elif format_type == "isbn":
return "https://www.worldcat.org/isbn/{0}".format(self.val) return "https://www.worldcat.org/isbn/{0}".format(self.val)
elif format_type == "doi": elif format_type == "doi":