diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2021-04-14 21:17:36 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2021-04-14 21:17:36 +0200 |
commit | ab6322ef93cfbb3d518e1f5a157d8e97f94428d1 (patch) | |
tree | 3269f2cdd495c0467dffacbde19ca3fc5ce41dd3 /newspipe | |
parent | chg: [JavaScript] Updated bootstrap-select (diff) | |
download | newspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.tar.gz newspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.tar.bz2 newspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.zip |
new [commands]: added fix_article_entry_id command.
Diffstat (limited to 'newspipe')
-rwxr-xr-x | newspipe/commands.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newspipe/commands.py b/newspipe/commands.py index a12f92ce..06b7dda9 100755 --- a/newspipe/commands.py +++ b/newspipe/commands.py @@ -116,6 +116,19 @@ def delete_read_articles(): print("Read articles deleted.") +@application.cli.command("fix_article_entry_id") +def fix_article_entry_id(): + filter = {} + filter["entry_id"] = None + articles = ArticleController().read(**filter).limit(50) + for article in articles: + try: + article.entry_id = str(article.id) + db.session.commit() + except: + db.session.rollback() + + @application.cli.command("fetch_asyncio") @click.option('--user-id', default=None, help='Id of the user') @click.option('--feed-id', default=None, help='If of the feed') |