1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-10-18 16:45:53 +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':
return "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":
return "ISBN"
elif format_type == "doi":
@ -149,7 +149,7 @@ class Identifiers(Base):
if format_type == "amazon" or format_type == "asin":
return "https://amazon.com/dp/{0}".format(self.val)
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":
return "https://www.worldcat.org/isbn/{0}".format(self.val)
elif format_type == "doi":