Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to filter entries by title per subscription #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sebhoss
Copy link

@sebhoss sebhoss commented Jul 4, 2024

fixes #6

Signed-off-by: Sebastian Hoß <[email protected]>
@sebhoss
Copy link
Author

sebhoss commented Aug 18, 2024

@tulir sorry missed that there were lint errors - I hope that those are fixed now..

@sebhoss
Copy link
Author

sebhoss commented Aug 18, 2024

Ok sorry again @tulir - third time's a charm? This time I installed all the tools and basically run the entire lint pipeline locally:

  • isort ./rss
  • black ./rss
  • pre-commit run -av trailing-whitespace
  • pre-commit run -av end-of-file-fixer
  • pre-commit run -av check-yaml
  • pre-commit run -av check-added-large-files

All checks are passing locally - sorry again for the inconvenience..

Comment on lines +111 to +121
if title_exclude_filter:
self.log.debug(
f"Feed '{feed.id}' ({feed.title}) has exclude filter '{title_exclude_filter}'"
)
if re.search(title_exclude_filter, entry.title):
self.log.info(f"Excluded '{entry.title}'")
return None
else:
self.log.debug(f"Not excluding '{entry.title}'")
else:
self.log.debug(f"Feed '{feed.id}' ({feed.title}) has no exclude filter")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These logs should be .trace() instead of debug or removed entirely

)
@command.argument("feed_id", "feed ID", parser=int)
@command.argument("title_exclude_filter", "title exclude filter", pass_raw=True)
async def set_filter(self, evt: MessageEvent, feed_id: int, title_exclude_filter: str) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should validate the filter before saving it (probably just re.compile)

@@ -18,7 +18,7 @@
upgrade_table = UpgradeTable()


@upgrade_table.register(description="Latest revision", upgrades_to=3)
@upgrade_table.register(description="Latest revision", upgrades_to=4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to update the CREATE TABLE statement with the new column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to filter posted feed items by regex on item title
2 participants