aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2021-04-14 21:17:36 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2021-04-14 21:17:36 +0200
commitab6322ef93cfbb3d518e1f5a157d8e97f94428d1 (patch)
tree3269f2cdd495c0467dffacbde19ca3fc5ce41dd3
parentchg: [JavaScript] Updated bootstrap-select (diff)
downloadnewspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.tar.gz
newspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.tar.bz2
newspipe-ab6322ef93cfbb3d518e1f5a157d8e97f94428d1.zip
new [commands]: added fix_article_entry_id command.
-rw-r--r--instance/sqlite.py13
-rwxr-xr-xnewspipe/commands.py13
2 files changed, 13 insertions, 13 deletions
diff --git a/instance/sqlite.py b/instance/sqlite.py
index 0fec8f3d..43cdc2af 100644
--- a/instance/sqlite.py
+++ b/instance/sqlite.py
@@ -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
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')
bgstack15