From b6ca4aaa46317c2701ea245d384f065d58dd5f49 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Fri, 5 Apr 2024 15:59:24 +0000 Subject: [PATCH] Fixed adding of URLs via chat (Thank you roughnecks) --- slixfeed/action.py | 15 +++++++++++++-- slixfeed/task.py | 20 ++++++++++++++++++++ slixfeed/version.py | 4 ++-- slixfeed/xmpp/process.py | 15 +++++++++++++-- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/slixfeed/action.py b/slixfeed/action.py index adabd04..295139b 100644 --- a/slixfeed/action.py +++ b/slixfeed/action.py @@ -915,9 +915,20 @@ async def add_feed(self, jid_bare, db_file, url, identifier): else: feed_updated = None entries_count = len(feed.entries) + feed_properties = { + "version" : '', + "encoding" : '', + "language" : '', + "rating" : '', + "entries_count" : entries_count, + "icon" : '', + "image" : '', + "logo" : '', + "ttl" : '', + "updated" : feed_updated, + } await sqlite.update_feed_properties(db_file, feed_id, - entries_count, - feed_updated) + feed_properties) feed_id = sqlite.get_feed_id(db_file, url) feed_id = feed_id[0] new_entries = get_properties_of_entries( diff --git a/slixfeed/task.py b/slixfeed/task.py index 431df19..b0753fb 100644 --- a/slixfeed/task.py +++ b/slixfeed/task.py @@ -351,6 +351,12 @@ async def check_updates(self, jid_bare): for url in urls: url = url[0] print('STA',url) + + # # Skip Reddit + # if 'reddit.com' in str(url).lower(): + # print('Reddit Atom Syndication feeds are not supported by Slixfeed.') + # print('Skipping URL:', url) + # continue result = await fetch.http(url) status_code = result['status_code'] @@ -361,6 +367,20 @@ async def check_updates(self, jid_bare): document = result['content'] feed = parse(document) + # # Skip Librarian + # if 'librarian' in feed.feed.title.lower(): + # print('Librarian RSS feeds are not supported by Slixfeed.') + # print('Ask the Librarian developers to migrate to Atom Syndication.') + # print('Skipping URL:', url) + # continue + + # # Skip Mastodon + # if 'mastodon' in feed.feed.generator.lower(): + # print('Mastodon RSS feeds are not supported by Slixfeed.') + # print('Ask the Mastodon developers to migrate to Atom Syndication.') + # print('Skipping URL:', url) + # continue + feed_valid = 0 if feed.bozo else 1 await sqlite.update_feed_validity(db_file, feed_id, feed_valid) diff --git a/slixfeed/version.py b/slixfeed/version.py index 992dc2c..1c7cbfa 100644 --- a/slixfeed/version.py +++ b/slixfeed/version.py @@ -1,2 +1,2 @@ -__version__ = '0.1.53' -__version_info__ = (0, 1, 53) +__version__ = '0.1.54' +__version_info__ = (0, 1, 54) diff --git a/slixfeed/xmpp/process.py b/slixfeed/xmpp/process.py index f88cc96..63e7c22 100644 --- a/slixfeed/xmpp/process.py +++ b/slixfeed/xmpp/process.py @@ -352,9 +352,20 @@ async def message(self, message): else: feed_updated = None entries_count = len(feed.entries) + feed_properties = { + "version" : '', + "encoding" : '', + "language" : '', + "rating" : '', + "entries_count" : entries_count, + "icon" : '', + "image" : '', + "logo" : '', + "ttl" : '', + "updated" : feed_updated, + } await sqlite.update_feed_properties(db_file, feed_id, - entries_count, - feed_updated) + feed_properties) feed_id = sqlite.get_feed_id(db_file, url) feed_id = feed_id[0] new_entries = action.get_properties_of_entries(