From 521b46e60d27204841e13dd4e98b0c7209d7b37a Mon Sep 17 00:00:00 2001 From: Asher Max Schweigart Date: Mon, 3 Mar 2025 17:29:29 -0500 Subject: [PATCH] Adding eBooks.com identifier type --- cps/db.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cps/db.py b/cps/db.py index 15921d7a..9cdffdfb 100644 --- a/cps/db.py +++ b/cps/db.py @@ -103,13 +103,13 @@ class Identifiers(Base): val = Column(String(collation='NOCASE'), nullable=False) book = Column(Integer, ForeignKey('books.id'), nullable=False) amazon = { - "jp": "co.jp", - "uk": "co.uk", - "us": "com", - "au": "com.au", - "be": "com.be", - "br": "com.br", - "tr": "com.tr", + "jp": "co.jp", + "uk": "co.uk", + "us": "com", + "au": "com.au", + "be": "com.be", + "br": "com.br", + "tr": "com.tr", "mx": "com.mx", } @@ -153,6 +153,8 @@ class Identifiers(Base): return "ISFDB" elif format_type == "storygraph": return "StoryGraph" + elif format_type == "ebooks": + return "eBooks.com" if format_type == "lubimyczytac": return "Lubimyczytac" if format_type == "databazeknih": @@ -198,6 +200,8 @@ class Identifiers(Base): return "https://www.databazeknih.cz/knihy/{0}".format(self.val) elif format_type == "storygraph": return "https://app.thestorygraph.com/books/{0}".format(self.val) + elif format_type == "ebooks": + return "https://www.ebooks.com/en-us/book/{0}".format(self.val) elif self.val.lower().startswith("javascript:"): return quote(self.val) elif self.val.lower().startswith("data:"):