Add --expire flag to cache command
MODIFY
plextraktsync/cli.py
plextraktsync/cli.py
@@ -73,6 +73,7 @@ def cli(ctx, version: bool):
help="Limit entries to be printed",
)
@click.option("--reverse", is_flag=True, default=False, help="Sort reverse")
+@click.option("--expire", is_flag=True, default=False, help="Expire given url")
@click.argument("url", required=False)
def cache():
"""

MODIFY
plextraktsync/commands/cache.py
plextraktsync/commands/cache.py
@@ -90,9 +90,13 @@ def cache_status(cache):
return f'Total rows: {len(cache.responses)} responses, {len(cache.redirects)} redirects'
-def cache(sort: str, limit: int, reverse: bool, url: str):
+def cache(sort: str, limit: int, reverse: bool, expire: bool, url: str):
session = factory.session
+ if expire:
+ expire_url(session, url)
+ return
+
if url:
inspect_url(session, url)
return

Add --expire flag to cache command