~cedric/newspipe

ab6322ef93cfbb3d518e1f5a157d8e97f94428d1 — Cédric Bonhomme 27 days ago 3a0b961 master
new [commands]: added fix_article_entry_id command.
2 files changed, 13 insertions(+), 13 deletions(-)

M instance/sqlite.py
M newspipe/commands.py
M instance/sqlite.py => instance/sqlite.py +0 -13
@@ 19,19 19,6 @@ SQLALCHEMY_DATABASE_URI = "sqlite:///newspipe.db"

# Security
CONTENT_SECURITY_POLICY = {
    'default-src': '\'self\'',
    'img-src': '*',
    'media-src': [
        'youtube.com',
    ],
    'script-src': [
        '\'self\'',
        '\'unsafe-inline\'',
    ],
    'style-src': [
        '\'self\'',
        '\'unsafe-inline\'',
    ]
}

# Crawler

M newspipe/commands.py => newspipe/commands.py +13 -0
@@ 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')