From 95f8d6d3ff734c6baf462d1a02f82547db1118af Mon Sep 17 00:00:00 2001 From: John Doty Date: Sun, 20 Oct 2024 08:14:43 -0700 Subject: [PATCH] Force refresh --- cry/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cry/cli.py b/cry/cli.py index 50d5e5a..9d91850 100644 --- a/cry/cli.py +++ b/cry/cli.py @@ -147,7 +147,8 @@ def import_opml(opml_file): @cli.command(name="refresh") @click.argument("url", required=False, default=None) -def refresh(url): +@click.option("--force", "-f", default=False, is_flag=True) +def refresh(url, force): """Refresh one or more feeds. If a URL is specified, refresh that URL. Otherwise, refresh all subscribed @@ -164,6 +165,9 @@ def refresh(url): else: feeds = db.load_all_meta() + if force: + feeds = [feed.FeedMeta.from_url(f.url) for f in feeds] + click.echo(f"Refreshing {len(feeds)} feed(s)...") results = asyncio.run(feed.fetch_many(feeds))