URL encode href before saving to sync.db

When pushing objects, the unencoded uri path would be saved into the
sync.db. The unencoded path and the encoded path from the server would
be seen as two different objects, causing both to be resynced
unnecessarily.

Signed-off-by: Randy Ramos <rramos1295@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Randy Ramos 2017-09-06 17:17:40 -04:00 committed by Lukas Fleischer
parent 8ab3106f6b
commit e943b0605f

View File

@ -10,6 +10,7 @@ import ssl
import subprocess
import sys
import textwrap
import urllib.parse
import xml.etree.ElementTree as etree
@ -242,7 +243,7 @@ def push_object(conn, objhash):
etag = next(iter(etagdict.values()))
etag = etag.strip('"')
return (href, etag)
return (urllib.parse.quote(href), etag)
def push_objects(objhashes, conn, syncdb, etagdict):