From 13c16490bd60eb8c6c43a345457e9a19a81f2a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 3 Jan 2023 18:51:42 +0100 Subject: [PATCH] handle subcategory names ending with 'y' --- docs/supportedsites.md | 2 +- scripts/supportedsites.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 74085063..de99fc37 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -142,7 +142,7 @@ Consider all sites to be NSFW unless otherwise known. Desktopography https://desktopography.net/ - Entrys, Exhibitions + Entries, Exhibitions diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py index 1df98ca4..2c0046b2 100755 --- a/scripts/supportedsites.py +++ b/scripts/supportedsites.py @@ -127,7 +127,6 @@ SUBCATEGORY_MAP = { "art" : "Art", "audio" : "Audio", "doujin" : "Doujin", - "gallery": "Galleries", "image" : "individual Images", "index" : "Site Index", "issue" : "Comic Issues", @@ -141,7 +140,6 @@ SUBCATEGORY_MAP = { "tweets" : "", "user" : "User Profiles", "watch" : "Watches", - "category" : "Categories", "following" : "", "related-pin" : "related Pins", "related-board": "", @@ -366,7 +364,11 @@ def subcategory_text(c, sc): return SUBCATEGORY_MAP[sc] sc = sc.capitalize() - return sc if sc.endswith("s") else sc + "s" + if sc.endswith("y"): + sc = sc[:-1] + "ies" + elif not sc.endswith("s"): + sc += "s" + return sc def category_key(c):