From 05e3f5bc1097a9541535e048fa17404c362eecbd Mon Sep 17 00:00:00 2001 From: Linusp Date: Fri, 24 May 2024 16:45:32 +0800 Subject: [PATCH] Optimized `InoreaderClient.fetch_articles` and release v0.7.1 --- CHANGELOG.md | 6 ++++++ inoreader/client.py | 7 +++++-- pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5741ec8..ed7c318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v0.7.1 + +Changed + +- Optimized `InoreaderClient.fetch_articles` for less API calls when tags are specified + ## v0.7.0 Removed diff --git a/inoreader/client.py b/inoreader/client.py index 421d763..429ef5d 100644 --- a/inoreader/client.py +++ b/inoreader/client.py @@ -166,8 +166,11 @@ def fetch_articles( ): self.check_token() - if not stream_id and folder: - stream_id = self.GENERAL_TAG_TEMPLATE.format(folder) + if not stream_id: + if folder: + stream_id = self.GENERAL_TAG_TEMPLATE.format(folder) + elif tags: + stream_id = self.GENERAL_TAG_TEMPLATE.format(tags[0]) params = {"stream_id": stream_id, "n": n, "c": str(uuid4())} if unread: diff --git a/pyproject.toml b/pyproject.toml index 6f0e8f3..ed4979c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "python-inoreader" -version = "0.7.0" +version = "0.7.1" description = "Python wrapper of Inoreader API" authors = [ {name = "Linusp", email = "linusp1024@gmail.com"},