mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-07-13 09:59:28 +02:00
Update content_discovery_currently_popular.py
This commit is contained in:
@ -98,10 +98,11 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
|||||||
events = cli.database().query([filter1])
|
events = cli.database().query([filter1])
|
||||||
ns.finallist = {}
|
ns.finallist = {}
|
||||||
for event in events:
|
for event in events:
|
||||||
ns.finallist[event.id().to_hex()] = 0
|
if event.created_at().as_secs() > timestamp_hour_ago:
|
||||||
filt = Filter().kinds([9735, 7, 1]).event(event.id()).since(lasthour)
|
ns.finallist[event.id().to_hex()] = 0
|
||||||
reactions = cli.database().query([filt])
|
filt = Filter().kinds([9735, 7, 1]).event(event.id()).since(lasthour)
|
||||||
ns.finallist[event.id().to_hex()] = len(reactions)
|
reactions = cli.database().query([filt])
|
||||||
|
ns.finallist[event.id().to_hex()] = len(reactions)
|
||||||
|
|
||||||
result_list = []
|
result_list = []
|
||||||
finallist_sorted = sorted(ns.finallist.items(), key=lambda x: x[1], reverse=True)[:int(options["max_results"])]
|
finallist_sorted = sorted(ns.finallist.items(), key=lambda x: x[1], reverse=True)[:int(options["max_results"])]
|
||||||
|
Reference in New Issue
Block a user