query will now run on Photos 5

This commit is contained in:
Rhet Turnbull
2019-11-17 08:53:24 -08:00
parent a4b5f2a501
commit 10f0cf1092

View File

@@ -860,6 +860,15 @@ class PhotosDB:
self._dbphotos[uuid]["originalFilename"] = row[3] self._dbphotos[uuid]["originalFilename"] = row[3]
self._dbphotos[uuid]["filename"] = row[12] self._dbphotos[uuid]["filename"] = row[12]
self._dbphotos[uuid]["directory"] = row[11] self._dbphotos[uuid]["directory"] = row[11]
# these will get filled in later
# init to avoid key errors
self._dbphotos[uuid]["extendedDescription"] = None # fill this in later
self._dbphotos[uuid]["localAvailability"] = None
self._dbphotos[uuid]["remoteAvailability"] = None
self._dbphotos[uuid]["isMissing"] = None
self._dbphotos[uuid]["hasAdjustments"] = None
# self._dbphotos[uuid]["isMissing"] = row[14] # self._dbphotos[uuid]["isMissing"] = row[14]
# logger.debug( # logger.debug(
# "Fetching data for photo %d %s %s %s %s %s: %s" # "Fetching data for photo %d %s %s %s %s %s: %s"
@@ -1082,19 +1091,24 @@ class PhotoInfo:
def path(self): def path(self):
photopath = "" photopath = ""
vol = self.__info["volume"] if self.__db._db_version < _PHOTOS_5_VERSION:
if vol is not None: vol = self.__info["volume"]
photopath = os.path.join("/Volumes", vol, self.__info["imagePath"]) if vol is not None:
else: photopath = os.path.join("/Volumes", vol, self.__info["imagePath"])
photopath = os.path.join(self.__db._masters_path, self.__info["imagePath"]) else:
photopath = os.path.join(self.__db._masters_path, self.__info["imagePath"])
if self.__info["isMissing"] == 1: if self.__info["isMissing"] == 1:
# logger.warning( # logger.warning(
# f"Skipping photo, not yet downloaded from iCloud: {photopath}" # f"Skipping photo, not yet downloaded from iCloud: {photopath}"
# ) # )
# logger.debug(self.__info) # logger.debug(self.__info)
photopath = None # path would be meaningless until downloaded photopath = None # path would be meaningless until downloaded
# TODO: Is there a way to use applescript to force the download in this # TODO: Is there a way to use applescript to force the download in this
else:
return "NOT YET IMPLEMENTED"
# Photos 5
# ZZZ
return photopath return photopath