From 17e43337a02e6e509cf52f04d2b72327d6b0d752 Mon Sep 17 00:00:00 2001 From: Jylpah Date: Tue, 24 Nov 2020 23:05:11 +0200 Subject: [PATCH] Update analyze_wotb_replays.py --- analyze_wotb_replays.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/analyze_wotb_replays.py b/analyze_wotb_replays.py index cefc11a..94fb30f 100755 --- a/analyze_wotb_replays.py +++ b/analyze_wotb_replays.py @@ -1480,15 +1480,7 @@ async def get_db_tank_tier_stats(db : motor.motor_asyncio.AsyncIOMotorDatabase, ( account_id, tier, battletime ) = str2ints(stat_id_str) tier_tanks = wg.get_tanks_by_tier(tier) time_buffer = 2*7*24*3600 - #bu.debug('Tank_ids: ' + ','.join(map(str, tier_tanks))) - - # if battletime == None: - # pipeline = [ { '$match': { '$and': [ { 'account_id': account_id }, { 'tank_id' : {'$in': tier_tanks} } ]}}, - # { '$sort': { 'last_battle_time': -1 }}, - # { '$group': { '_id': '$tank_id', 'doc': { '$first': '$$ROOT' }}}, - # { '$replaceRoot': { 'newRoot': '$doc' }}, - # { '$project': { '_id': 0 }} ] - # else: + pipeline = [ { '$match': { '$and': [ { 'account_id': account_id }, { 'last_battle_time': { '$lte': battletime + time_buffer }}, { 'tank_id' : {'$in': tier_tanks} } ]}}, { '$sort': { 'last_battle_time': -1 }}, { '$group': { '_id': '$tank_id', 'doc': { '$first': '$$ROOT' }}},