]> git.ipfire.org Git - ipfire.org.git/commitdiff
tracker: Import left data when a peer is created
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 16 Oct 2014 09:30:34 +0000 (11:30 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 16 Oct 2014 09:30:34 +0000 (11:30 +0200)
webapp/backend/tracker.py

index d5642c4ae332d9e6e83fce37f037492e4550c663..80f38c0204d68b72d6fe7bcfbdf579da85f56f5c 100644 (file)
@@ -132,9 +132,9 @@ class Tracker(Object):
 
                return False
 
-       def __insert_peer(self, peer_id, info_hash, address6=None, port6=None, address4=None, port4=None, **kwargs):
-               self.db.execute("INSERT INTO tracker(id, hash, address6, port6, address4, port4) \
-                       VALUES(%s, %s, %s, %s, %s, %s)", peer_id, info_hash, address6, port6, address4, port4)
+       def __insert_peer(self, peer_id, info_hash, address6=None, port6=None, address4=None, port4=None, left_data=0, **kwargs):
+               self.db.execute("INSERT INTO tracker(id, hash, address6, port6, address4, port4, left_data) \
+                       VALUES(%s, %s, %s, %s, %s, %s, %s)", peer_id, info_hash, address6, port6, address4, port4, left_data)
 
        def __update_peer(self, peer_id, info_hash, address6=None, port6=None,
                        address4=None, port4=None, downloaded=None, uploaded=None, left_data=None):