diff --git a/pyproject.toml b/pyproject.toml index ad7c326..e79f8f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "feather" -version = "1.1.1" +version = "1.1.0" authors = [ { name = 'Étienne "Reuh" Fildadut' } ] description = "file-based RSS reader client" readme = "README.md" diff --git a/src/feather/app.py b/src/feather/app.py index 22cde0a..3ef5697 100755 --- a/src/feather/app.py +++ b/src/feather/app.py @@ -160,26 +160,20 @@ class FeatherApp: article.write() updated_articles += 1 - # Remove or mark-as-read articles that we didn't get from the server but are in the JSON directory + # Remove articles that we didn't get from the server but are in the JSON directory removed_articles = 0 article_cutoff_timestamp = ( datetime.now().timestamp() - config.keep_read_articles_for ) for article in self.iter_articles(): - if article.id not in grabbed_article_paths: - # we only sync unread: articles we didn't get from the server were read or purged - if config.only_sync_unread_articles: - if article.last_write < article_cutoff_timestamp: - article.delete() - removed_articles += 1 - elif article.unread: - article.unread = False - article.regenerate() - updated_articles += 1 - # we sync all articles: articles we didn't get from the server were purged - else: - article.delete() - removed_articles += 1 + if ( + # we sync all articles: remove all articles that aren't on the server + not config.only_sync_unread_articles + # we only sync unread: only remove articles that are too old + or article.last_write < article_cutoff_timestamp + ) and article.id not in grabbed_article_paths: + article.delete() + removed_articles += 1 print( f"Synchronization successful ({new_articles} new articles, {updated_articles} updated, {removed_articles} removed)" diff --git a/uv.lock b/uv.lock index 3e036bc..a68fce4 100644 --- a/uv.lock +++ b/uv.lock @@ -69,7 +69,7 @@ wheels = [ [[package]] name = "feather" -version = "1.1.1" +version = "1.1.0" source = { editable = "." } dependencies = [ { name = "google-reader" },