Fix nip05: correct nostr-rs-relay DB schema
author column (BLOB) and content holds full event JSON, not profile JSON. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d4b9b209c7
commit
c71f02a7c7
1 changed files with 6 additions and 4 deletions
|
|
@ -30,9 +30,9 @@ let
|
|||
try:
|
||||
con = sqlite3.connect(f"file:{DB_PATH}?mode=ro", uri=True)
|
||||
rows = con.execute("""
|
||||
SELECT pub_key, content FROM event
|
||||
SELECT author, content FROM event
|
||||
WHERE kind = 0 AND (hidden IS NULL OR hidden = 0)
|
||||
GROUP BY pub_key
|
||||
GROUP BY author
|
||||
HAVING created_at = MAX(created_at)
|
||||
""").fetchall()
|
||||
con.close()
|
||||
|
|
@ -43,9 +43,11 @@ let
|
|||
|
||||
names = {}
|
||||
relays = {}
|
||||
for pub_key, content in rows:
|
||||
for author_blob, event_json in rows:
|
||||
try:
|
||||
meta = json.loads(content)
|
||||
event = json.loads(event_json)
|
||||
pub_key = event.get("pubkey", author_blob.hex())
|
||||
meta = json.loads(event.get("content", "{}"))
|
||||
name = meta.get("name", "").strip().lower()
|
||||
if not name:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue