From 1cefb2e8570fb6c219d919475da81eca1302a94b Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 3 Feb 2010 23:48:39 +0800 Subject: [PATCH] Fix playername siteid insert From Gerko on mailing list: > I just did a trial. Use bulkimport for a single Pokerstars file > switch setting and bulkimport a single Full tilt file. > When screening the db all players in the database show the same siteId > (2 for pokerstars) > Or the other way if the first site was Full Tilt. The Lambda function wasn't initialising the lambda function correctly. --- pyfpdb/Database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index a987b389..4b672733 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1756,10 +1756,10 @@ class Database: def getSqlPlayerIDs(self, pnames, siteid): result = {} if(self.pcache == None): - self.pcache = LambdaDict(lambda key:self.insertPlayer(key, siteid)) + self.pcache = LambdaDict(lambda key:self.insertPlayer(key[0], key[1])) for player in pnames: - result[player] = self.pcache[player] + result[player] = self.pcache[(player,siteid)] # NOTE: Using the LambdaDict does the same thing as: #if player in self.pcache: # #print "DEBUG: cachehit"