chore: add uv, linting, fixes (#39)
Some checks failed
CI / lint (push) Has been cancelled
/ release (push) Has been cancelled
CI / tests (push) Has been cancelled
/ pullrequest (push) Has been cancelled

* chore: add uv, linting, fixes
This commit is contained in:
dni ⚡ 2025-10-30 10:43:27 +01:00 committed by GitHub
parent 15079c3e58
commit 35584a230f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 2405 additions and 2752 deletions

View file

@ -1,5 +1,3 @@
from typing import Optional
from pydantic import BaseModel, Field
from .event import NostrEvent
@ -12,10 +10,10 @@ class NostrFilter(BaseModel):
ids: list[str] = []
authors: list[str] = []
kinds: list[int] = []
subscription_id: Optional[str] = None
since: Optional[int] = None
until: Optional[int] = None
limit: Optional[int] = None
subscription_id: str | None = None
since: int | None = None
until: int | None = None
limit: int | None = None
def matches(self, e: NostrEvent) -> bool:
# todo: starts with
@ -93,9 +91,12 @@ class NostrFilter(BaseModel):
if len(self.d):
d_s = ",".join([f"'{d}'" for d in self.d])
d_join = "INNER JOIN nostrrelay.event_tags d_tags ON nostrrelay.events.id = d_tags.event_id"
d_join = (
"INNER JOIN nostrrelay.event_tags d_tags "
"ON nostrrelay.events.id = d_tags.event_id"
)
d_where = f" d_tags.value in ({d_s}) AND d_tags.name = 'd'"
inner_joins.append(d_join)
where.append(d_where)