diff options
22 files changed, 35 insertions, 13 deletions
diff --git a/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py b/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py index 7842083a..95926d22 100644 --- a/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py +++ b/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py @@ -9,6 +9,7 @@ Create Date: 2016-09-21 08:00:27.160357 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "16f8fc3cf0cc" down_revision = "957d4c5b8ac9" branch_labels = None diff --git a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py index f94d85ce..e07ff6d7 100644 --- a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py +++ b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py @@ -10,6 +10,7 @@ Create Date: 2015-03-10 14:20:53.676344 from alembic import op import sqlalchemy as sa from datetime import datetime + revision = "17dcb75f3fe" down_revision = "cde34831ea" diff --git a/migrations/versions/19bdaa6208e_add_icon_column.py b/migrations/versions/19bdaa6208e_add_icon_column.py index a7542f5d..19d2977b 100644 --- a/migrations/versions/19bdaa6208e_add_icon_column.py +++ b/migrations/versions/19bdaa6208e_add_icon_column.py @@ -9,6 +9,7 @@ Create Date: 2015-07-03 12:09:58.596010 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "19bdaa6208e" down_revision = "422da2d0234" diff --git a/migrations/versions/1b750a389c22_remove_email_notification_column.py b/migrations/versions/1b750a389c22_remove_email_notification_column.py index f019faa9..60e02687 100644 --- a/migrations/versions/1b750a389c22_remove_email_notification_column.py +++ b/migrations/versions/1b750a389c22_remove_email_notification_column.py @@ -9,6 +9,7 @@ Create Date: 2015-02-25 23:01:07.253429 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "1b750a389c22" down_revision = "48f561c0ce6" diff --git a/migrations/versions/2472eddbf44b_update_of_the_user_model.py b/migrations/versions/2472eddbf44b_update_of_the_user_model.py index 61bd10d2..cb6de571 100644 --- a/migrations/versions/2472eddbf44b_update_of_the_user_model.py +++ b/migrations/versions/2472eddbf44b_update_of_the_user_model.py @@ -9,6 +9,7 @@ Create Date: 2016-03-01 22:35:03.659694 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "2472eddbf44b" down_revision = "ac35c979311a" branch_labels = None diff --git a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py index cc58a026..9212e5ab 100644 --- a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py +++ b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py @@ -9,6 +9,7 @@ Create Date: 2015-08-03 14:36:21.626411 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "25ca960a207" down_revision = "19bdaa6208e" diff --git a/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py b/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py index 2f06cd2b..8d6c8ae8 100644 --- a/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py +++ b/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py @@ -9,6 +9,7 @@ Create Date: 2016-11-08 07:41:13.923531 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "2c5cc05216fa" down_revision = "be2b8b6f33dd" branch_labels = None diff --git a/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py b/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py index 3fd624cf..4e0df180 100644 --- a/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py +++ b/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py @@ -9,6 +9,7 @@ Create Date: 2016-02-12 21:51:40.868539 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "3f83bfe93fc" down_revision = "25ca960a207" diff --git a/migrations/versions/422da2d0234_adding_filters_field.py b/migrations/versions/422da2d0234_adding_filters_field.py index 2d175d4b..084ddf09 100644 --- a/migrations/versions/422da2d0234_adding_filters_field.py +++ b/migrations/versions/422da2d0234_adding_filters_field.py @@ -9,6 +9,7 @@ Create Date: 2015-05-18 23:03:15.809549 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "422da2d0234" down_revision = "17dcb75f3fe" diff --git a/migrations/versions/48f561c0ce6_add_column_entry_id.py b/migrations/versions/48f561c0ce6_add_column_entry_id.py index 2a9a1590..a233d0e5 100644 --- a/migrations/versions/48f561c0ce6_add_column_entry_id.py +++ b/migrations/versions/48f561c0ce6_add_column_entry_id.py @@ -9,6 +9,7 @@ Create Date: 2015-02-18 21:17:19.346998 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "48f561c0ce6" down_revision = None branch_labels = None diff --git a/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py b/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py index 2ca80a11..9f98e68b 100644 --- a/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py +++ b/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py @@ -9,6 +9,7 @@ Create Date: 2016-10-06 11:02:41.356322 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "5553a6c05fa7" down_revision = "f700c4237e9d" branch_labels = None diff --git a/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py b/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py index 6c1fcc9b..188ec46f 100644 --- a/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py +++ b/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py @@ -9,6 +9,7 @@ Create Date: 2016-02-13 11:33:14.183576 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "661199d8768a" down_revision = "3f83bfe93fc" branch_labels = None diff --git a/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py b/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py index c2262dec..47e56e2e 100644 --- a/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py +++ b/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py @@ -9,6 +9,7 @@ Create Date: 2016-10-06 13:47:32.784711 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "8bf5694c0b9e" down_revision = "5553a6c05fa7" branch_labels = None diff --git a/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py b/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py index c988d0b0..ac5c47be 100644 --- a/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py +++ b/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py @@ -9,6 +9,7 @@ Create Date: 2016-09-20 14:35:31.302555 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "957d4c5b8ac9" down_revision = "2472eddbf44b" branch_labels = None diff --git a/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py b/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py index f272598e..ee16ab78 100644 --- a/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py +++ b/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py @@ -9,6 +9,7 @@ Create Date: 2016-02-18 08:54:43.786641 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "ac35c979311a" down_revision = "661199d8768a" branch_labels = None diff --git a/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py b/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py index 2ddb8f9f..f783425f 100644 --- a/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py +++ b/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py @@ -10,6 +10,7 @@ Create Date: 2017-05-23 21:42:37.636307 from alembic import op import sqlalchemy as sa from datetime import datetime + revision = "b329a1a7366f" down_revision = "2c5cc05216fa" branch_labels = None diff --git a/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py b/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py index 82792546..1a97d271 100644 --- a/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py +++ b/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py @@ -9,6 +9,7 @@ Create Date: 2018-04-04 23:26:52.517804 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "bdd38bd755cb" down_revision = "b329a1a7366f" branch_labels = None diff --git a/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py b/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py index bac2fd5c..fa733719 100644 --- a/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py +++ b/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py @@ -9,6 +9,7 @@ Create Date: 2016-10-24 13:28:55.964803 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "be2b8b6f33dd" down_revision = "fa10b0bdd045" branch_labels = None diff --git a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py index c0a58503..0c6ada9c 100644 --- a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py +++ b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py @@ -10,6 +10,7 @@ Create Date: 2015-03-04 22:59:44.665979 from alembic import op import sqlalchemy as sa from datetime import datetime + revision = "cde34831ea" down_revision = "1b750a389c22" diff --git a/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py b/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py index 83175034..626d0f1a 100644 --- a/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py +++ b/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py @@ -9,6 +9,7 @@ Create Date: 2016-10-05 08:47:51.384069 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "f700c4237e9d" down_revision = "16f8fc3cf0cc" branch_labels = None diff --git a/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py b/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py index de5939ed..b94527cf 100644 --- a/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py +++ b/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py @@ -9,6 +9,7 @@ Create Date: 2016-10-07 10:43:04.428178 # revision identifiers, used by Alembic. from alembic import op import sqlalchemy as sa + revision = "fa10b0bdd045" down_revision = "8bf5694c0b9e" branch_labels = None diff --git a/newspipe/lib/article_utils.py b/newspipe/lib/article_utils.py index 243aec5d..bc046835 100644 --- a/newspipe/lib/article_utils.py +++ b/newspipe/lib/article_utils.py @@ -155,7 +155,7 @@ def process_filters(filters, article, only_actions=None): if only_actions is None: only_actions = set(FiltersAction) for filter_ in filters: - match = False + matching = False try: pattern = filter_.get("pattern", "") filter_type = FiltersType(filter_.get("type")) @@ -181,20 +181,21 @@ def process_filters(filters, article, only_actions=None): continue title = article.get("title", "").lower() tags = [tag.lower() for tag in article.get("tags", [])] - if filter_type is FiltersType.REGEX: - match = re.match(pattern, title) - elif filter_type is FiltersType.MATCH: - match = pattern in title - elif filter_type is FiltersType.EXACT_MATCH: - match = pattern == title - elif filter_type is FiltersType.TAG_MATCH: - match = pattern in tags - elif filter_type is FiltersType.TAG_CONTAINS: - match = any(pattern in tag for tag in tags) + match filter_type: + case FiltersType.REGEX: + matching = re.match(pattern, title) + case FiltersType.MATCH: + matching = pattern in title + case FiltersType.EXACT_MATCH: + matching = pattern == title + case FiltersType.TAG_MATCH: + matching = pattern in tags + case FiltersType.TAG_CONTAINS: + matching = any(pattern in tag for tag in tags) take_action = ( - match + matching and filter_trigger is FiltersTrigger.MATCH - or not match + or not matching and filter_trigger is FiltersTrigger.NO_MATCH ) |