diff --git a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py index 44d259f..f5a4090 100644 --- a/nostr_dvm/tasks/content_discovery_currently_popular_topic.py +++ b/nostr_dvm/tasks/content_discovery_currently_popular_topic.py @@ -33,7 +33,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): search_list = [] avoid_list = [] must_list = [] - individual_result = False + personalized = False result = "" def __init__(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None, @@ -52,8 +52,8 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): dvm_config.SCRIPT = os.path.abspath(__file__) - if self.options.get("individual_result"): - self.individual_result = bool(self.options.get("individual_result")) + if self.options.get("personalized"): + self.personalized = bool(self.options.get("personalized")) self.last_schedule = Timestamp.now().as_secs() if self.options.get("search_list"): @@ -74,7 +74,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): init_logger(LogLevel.DEBUG) self.sync_db() - if not self.individual_result: + if not self.personalized: self.result = self.calculate_Result(self.request_form) def is_input_supported(self, tags, client=None, dvm_config=None): @@ -113,7 +113,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface): def process(self, request_form): # if the dvm supports individual results, recalculate it every time for the request - if self.individual_result: + if self.personalized: return self.calculate_Result(request_form) #else return the result that gets updated once every schenduled update. In this case on database update. else: diff --git a/tests/discovery.py b/tests/discovery.py index 532abc6..0604789 100644 --- a/tests/discovery.py +++ b/tests/discovery.py @@ -46,7 +46,8 @@ def playground(): "inkblot", "covid", "robot", "pandemic", "bethesda", "zap farming", " defi ", " minister ", "nostr-hotter-site", " ai ", "palestine", "https://boards.4chan", "https://techcrunch.com", "https://screenrant.com"], "db_name": "db/nostr_recent_notes_plants.db", - "db_since": 10 * 60 * 60} # 10h + "db_since": 10 * 60 * 60, # 10h + "personalized": False} image = "https://image.nostr.build/a816f3f5e98e91e8a47d50f4cd7a2c17545f556d9bb0a6086a659b9abdf7ab68.jpg" description = "I show recent notes about plants and gardening" @@ -72,8 +73,9 @@ def playground(): "must_list": ["http"], - "db_name": "db/nostr_recent_notes_animals.db", - "db_since": 48 * 60 * 60} # 10h + "db_name": "db/nostr_recent_notes_animals.db", + "db_since": 48 * 60 * 60, # 48h, + "personalized": False} image = "https://image.nostr.build/f609311532c470f663e129510a76c9a1912ae9bc4aaaf058e5ba21cfb512c88e.jpg" description = "I show recent notes about animals"