From c489b76145e664c89dc7ef3280c19b0042cb74c0 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Tue, 5 Mar 2024 16:04:02 +0100 Subject: [PATCH] show recommendations in original order, not time sorted --- tests/discovery.py | 39 +++++++++++++++++++ ui/noogle/src/components/NoteTable.vue | 15 ++++--- .../components/RecommendationGeneration.vue | 12 ++++-- ui/noogle/src/components/Search.vue | 4 +- ui/noogle/src/components/helper/Helper.vue | 32 +++++++++++++-- 5 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 tests/discovery.py diff --git a/tests/discovery.py b/tests/discovery.py new file mode 100644 index 0000000..cb2d481 --- /dev/null +++ b/tests/discovery.py @@ -0,0 +1,39 @@ +import os +from pathlib import Path + +import dotenv +from nostr_sdk import Keys + +from nostr_dvm.tasks import content_discovery_test +from nostr_dvm.utils.admin_utils import AdminConfig +from nostr_dvm.utils.backend_utils import keep_alive + + +def playground(): + # Generate an optional Admin Config, in this case, whenever we give our DVMs this config, they will (re)broadcast + # their NIP89 announcement + # You can create individual admins configs and hand them over when initializing the dvm, + # for example to whilelist users or add to their balance. + # If you use this global config, options will be set for all dvms that use it. + admin_config = AdminConfig() + admin_config.REBROADCAST_NIP89 = False + admin_config.UPDATE_PROFILE = False + + discovery_test = content_discovery_test.build_example("Dicovery Test DVM", "discovery_content_test", admin_config) + discovery_test.run() + + keep_alive() + + +if __name__ == '__main__': + env_path = Path('.env') + if not env_path.is_file(): + with open('.env', 'w') as f: + print("Writing new .env file") + f.write('') + if env_path.is_file(): + print(f'loading environment from {env_path.resolve()}') + dotenv.load_dotenv(env_path, verbose=True, override=True) + else: + raise FileNotFoundError(f'.env file not found at {env_path} ') + playground() diff --git a/ui/noogle/src/components/NoteTable.vue b/ui/noogle/src/components/NoteTable.vue index a9712f3..7a1bdc1 100644 --- a/ui/noogle/src/components/NoteTable.vue +++ b/ui/noogle/src/components/NoteTable.vue @@ -1,7 +1,8 @@