Check if subscribing fails because already exists

This commit is contained in:
2023-12-22 18:05:55 +01:00
parent 5274a6622e
commit 08b62de62f

View File

@@ -191,7 +191,10 @@ class TTRSS:
body = self._make_request( body = self._make_request(
"subscribeToFeed", feed_url=feed_url, category_id=cat_id "subscribeToFeed", feed_url=feed_url, category_id=cat_id
) )
if body["content"]["status"]["code"] != 1: status = body["content"]["status"]["code"]
if status == 0:
raise Exception("Feed already exists")
if status != 1:
raise Exception(f"Failed to subscribe to {feed_url}: {body}") raise Exception(f"Failed to subscribe to {feed_url}: {body}")