pass client media count to server

This commit is contained in:
Damien Elmes 2013-12-09 17:36:17 +09:00
parent f057242da1
commit 4e900b4608

View file

@ -3,7 +3,6 @@
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import urllib
import os
import sys
import gzip
import random
@ -16,6 +15,7 @@ from anki.consts import *
from hooks import runHook
import anki
# syncing vars
HTTP_TIMEOUT = 90
HTTP_PROXY = None
@ -750,8 +750,8 @@ class MediaSyncer(object):
# step 5: sanity check during beta testing
# NOTE: when removing this, need to move server tidyup
# back from sanity check to addFiles
s = self.server.mediaSanity()
c = self.mediaSanity()
s = self.server.mediaSanity(client=c)
self.col.log("mediaSanity", c, s)
if c != s:
# if the sanity check failed, force a resync
@ -797,9 +797,9 @@ class RemoteMediaServer(HttpSyncer):
return json.loads(
self.req("addFiles", StringIO(zip), comp=0))
def mediaSanity(self):
def mediaSanity(self, **kw):
return json.loads(
self.req("mediaSanity"))
self.req("mediaSanity", StringIO(json.dumps(kw))))
def mediaList(self):
return json.loads(