From 6dca917130c4b331f52f431b3033b63a0744b50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Mon, 2 Oct 2017 17:35:33 +0200 Subject: Fetch given friendlists in parallel --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d6c655a..fa0b728 100755 --- a/main.py +++ b/main.py @@ -77,10 +77,11 @@ def lobby(): friends = request.args.get('friends') if friends: - for steamid in friends.split(','): - for friend in steam.getFriends(steamid): - if friend not in steamids: - steamids[friend] = {} + friendList = friends.split(',') + profiles = steam.getMultipleFriends(friendList) + for steamid, profile in profiles.items(): + for friendid in profile['friends']: + steamids[friendid] = {} else: # Load config (steamids, names) with open(os.path.join(CONFIG, 'lobby.json'), 'rt') as config: -- cgit v1.2.3