re-jig 'the logic'

This commit is contained in:
meejah 2018-04-22 00:23:40 -06:00
parent 6d5355fda3
commit fbc142d346

View File

@ -1403,14 +1403,11 @@ class Downloader(QueueMixin, WriteFileMixin):
db_entry.ctime_ns != current_statinfo.ctime_ns or \ db_entry.ctime_ns != current_statinfo.ctime_ns or \
db_entry.size != current_statinfo.size): db_entry.size != current_statinfo.size):
is_conflict = True is_conflict = True
self._log("conflict because local change") self._log("conflict because local change0")
if db_entry.last_uploaded_uri is None: if db_entry.last_downloaded_uri is None \
pass or db_entry.last_uploaded_uri is None \
elif db_entry.last_downloaded_uri is None: or dmd_last_downloaded_uri is None:
pass
else:
if dmd_last_downloaded_uri is None:
# we've never downloaded anything before for this # we've never downloaded anything before for this
# file, but the other side might have created a new # file, but the other side might have created a new
# file "at the same time" # file "at the same time"
@ -1420,6 +1417,12 @@ class Downloader(QueueMixin, WriteFileMixin):
elif dmd_last_downloaded_uri != db_entry.last_downloaded_uri: elif dmd_last_downloaded_uri != db_entry.last_downloaded_uri:
is_conflict = True is_conflict = True
self._log("conflict because dmd_last_downloaded_uri != db_entry.last_downloaded_uri") self._log("conflict because dmd_last_downloaded_uri != db_entry.last_downloaded_uri")
self._log("{} != {}".format(dmd_last_downloaded_uri, db_entry.last_downloaded_uri))
else: # no local db_entry .. but has the file appeared locally meantime?
if current_statinfo.exists:
is_conflict = True
self._log("conflict because local change1")
if is_conflict: if is_conflict:
self._count('objects_conflicted') self._count('objects_conflicted')