When annotating results, don't send empty queries to Threshold
This commit is contained in:
parent
eb7ff88c15
commit
53cb9a7f76
|
@ -39,21 +39,30 @@ def annotate_results(results):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
online_info = None
|
||||||
|
num_users = None
|
||||||
|
num_chans = None
|
||||||
|
if nicks:
|
||||||
online_info = annotate_online(net, nicks)
|
online_info = annotate_online(net, nicks)
|
||||||
# Annotate the number of users in the channel
|
# Annotate the number of users in the channel
|
||||||
|
if channels:
|
||||||
num_users = annotate_num_users(net, channels)
|
num_users = annotate_num_users(net, channels)
|
||||||
# Annotate the number channels the user is on
|
# Annotate the number channels the user is on
|
||||||
|
if nicks:
|
||||||
num_chans = annotate_num_chans(net, nicks)
|
num_chans = annotate_num_chans(net, nicks)
|
||||||
for item in results:
|
for item in results:
|
||||||
if "net" in item:
|
if "net" in item:
|
||||||
if item["net"] == net:
|
if item["net"] == net:
|
||||||
if "nick" in item:
|
if "nick" in item:
|
||||||
|
if online_info:
|
||||||
if item["nick"] in online_info:
|
if item["nick"] in online_info:
|
||||||
item["online"] = online_info[item["nick"]]
|
item["online"] = online_info[item["nick"]]
|
||||||
if "channel" in item:
|
if "channel" in item:
|
||||||
|
if num_users:
|
||||||
if item["channel"] in num_users:
|
if item["channel"] in num_users:
|
||||||
item["num_users"] = num_users[item["channel"]]
|
item["num_users"] = num_users[item["channel"]]
|
||||||
if "nick" in item:
|
if "nick" in item:
|
||||||
|
if num_chans:
|
||||||
if item["nick"] in num_chans:
|
if item["nick"] in num_chans:
|
||||||
item["num_chans"] = num_chans[item["nick"]]
|
item["num_chans"] = num_chans[item["nick"]]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue