~cedric/newspipe

9e17197215a2e7b5390ee12aad79f3f876f15bf3 — Cédric Bonhomme 2 months ago d9fbc7f
only delete read article retrieved more than 60 days ago.
1 files changed, 2 insertions(+), 2 deletions(-)

M newspipe/commands.py
M newspipe/commands.py => newspipe/commands.py +2 -2
@@ 101,12 101,12 @@ def disable_inactive_users(last_seen):

@application.cli.command("delete_read_articles")
def delete_read_articles():
    "Delete read articles (and not liked) retrieved since more than 15 days ago."
    "Delete read articles (and not liked) retrieved since more than 60 days ago."
    filter = {}
    filter["user_id__ne"] = 1
    filter["readed"] = True
    filter["like"] = False
    filter["retrieved_date__lt"] = date.today() - relativedelta(days=15)
    filter["retrieved_date__lt"] = date.today() - relativedelta(days=60)
    articles = ArticleController().read(**filter).limit(5000)
    for article in articles:
        try: