added advanced search for notes

This commit is contained in:
Believethehype
2023-12-02 17:01:29 +01:00
parent 32aba97a6e
commit e8def92afb
4 changed files with 211 additions and 2 deletions

View File

@@ -23,6 +23,9 @@ class EventDefinitions:
KIND_NIP90_CONTENT_DISCOVERY = 5300
KIND_NIP90_RESULT_CONTENT_DISCOVERY = 6300
KIND_NIP90_PEOPLE_DISCOVERY = 5301
KIND_NIP90_RESULT_PEOPLE_DISCOVERY = 6301
KIND_NIP90_CONTENT_SEARCH = 5302
KIND_NIP90_RESULTS_CONTENT_SEARCH = 6302
KIND_NIP90_GENERIC = 5999
KIND_NIP90_RESULT_GENERIC = 6999
ANY_RESULT = [KIND_NIP90_RESULT_EXTRACT_TEXT,
@@ -34,6 +37,7 @@ class EventDefinitions:
KIND_NIP90_PEOPLE_DISCOVERY,
KIND_NIP90_RESULT_CONVERT_VIDEO,
KIND_NIP90_RESULT_CONTENT_DISCOVERY,
KIND_NIP90_RESULT_PEOPLE_DISCOVERY,
KIND_NIP90_RESULT_GENERIC]

View File

@@ -98,9 +98,9 @@ def post_process_list_to_events(result):
result_list = json.loads(result)
result_str = ""
for tag in result_list:
p_tag = Tag.parse(tag)
e_tag = Tag.parse(tag)
result_str = result_str + "nostr:" + EventId.from_hex(
p_tag.as_vec()[1]).to_bech32() + "\n"
e_tag.as_vec()[1]).to_bech32() + "\n"
return result_str