~cedric/newspipe

9c0c7b691d70c161acaee6e641d6fcced298d63f — Cédric Bonhomme 2 months ago 6b9cd7c
delete read articles retrieved since more than 15 days.
1 files changed, 2 insertions(+), 2 deletions(-)

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

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