From 1de74f7d8a78ea35118161fb036abd5330965bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sat, 10 Dec 2022 22:00:06 +0100 Subject: [PATCH] Sort URLs on index page alphabetical --- discord_rss_bot/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord_rss_bot/main.py b/discord_rss_bot/main.py index f674caf..357c3ce 100644 --- a/discord_rss_bot/main.py +++ b/discord_rss_bot/main.py @@ -200,6 +200,9 @@ def make_context_index(request) -> dict: hook = reader.get_tag(feed.url, "webhook") feed_list.append({"feed": feed, "webhook": hook}) + # Sort feed_list by feed url + feed_list.sort(key=lambda x: x["feed"].url) + feed_count: FeedCounts = reader.get_feed_counts() entry_count: EntryCounts = reader.get_entry_counts() context: dict[str, Any] = {