diff --git a/README.md b/README.md
index d3f8e71d..952a5eaf 100644
--- a/README.md
+++ b/README.md
@@ -1702,7 +1702,7 @@ Substitution Description
{lf} A line feed: '\n', alias for {newline}
{cr} A carriage return: '\r'
{crlf} a carriage return + line feed: '\r\n'
-{osxphotos_version} The osxphotos version, e.g. '0.42.86'
+{osxphotos_version} The osxphotos version, e.g. '0.42.87'
{osxphotos_cmd_line} The full command line used to run osxphotos
The following substitutions may result in multiple values. Thus if specified for
@@ -3573,7 +3573,7 @@ The following template field substitutions are availabe for use the templating s
|{lf}|A line feed: '\n', alias for {newline}|
|{cr}|A carriage return: '\r'|
|{crlf}|a carriage return + line feed: '\r\n'|
-|{osxphotos_version}|The osxphotos version, e.g. '0.42.86'|
+|{osxphotos_version}|The osxphotos version, e.g. '0.42.87'|
|{osxphotos_cmd_line}|The full command line used to run osxphotos|
|{album}|Album(s) photo is contained in|
|{folder_album}|Folder path + album photo is contained in. e.g. 'Folder/Subfolder/Album' or just 'Album' if no enclosing folder|
diff --git a/docs/.buildinfo b/docs/.buildinfo
index c5c5a3b6..fc10e2ec 100644
--- a/docs/.buildinfo
+++ b/docs/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 68de544013fe1e61b68c366a1cc4b278
+config: 14dd346aa3f2d151398f933f3307d0fe
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_modules/index.html b/docs/_modules/index.html
index 01e85c64..66d2e2f3 100644
--- a/docs/_modules/index.html
+++ b/docs/_modules/index.html
@@ -5,7 +5,7 @@
[docs] def render_template (
diff --git a/docs/_modules/osxphotos/photosdb/photosdb.html b/docs/_modules/osxphotos/photosdb/photosdb.html
index e8a28fa6..a84eda02 100644
--- a/docs/_modules/osxphotos/photosdb/photosdb.html
+++ b/docs/_modules/osxphotos/photosdb/photosdb.html
@@ -5,7 +5,7 @@
-
osxphotos.photosdb.photosdb — osxphotos 0.42.84 documentation
+
osxphotos.photosdb.photosdb — osxphotos 0.42.87 documentation
@@ -1232,6 +1232,9 @@
self . _dbphotos [ uuid ][ "import_uuid" ] = row [ 44 ]
self . _dbphotos [ uuid ][ "fok_import_session" ] = None
+
# photos 5+ only, for shared photos
+
self . _dbphotos [ uuid ][ "cloudownerhashedpersonid" ] = None
+
# compute signatures for finding possible duplicates
signature = self . _duplicate_signature ( uuid )
try :
@@ -1960,7 +1963,8 @@
{ asset_table } .ZTRASHEDDATE,
{ asset_table } .ZSAVEDASSETTYPE,
{ asset_table } .ZADDEDDATE,
-
{ asset_table } .Z_PK
+
{ asset_table } .Z_PK,
+
{ asset_table } .ZCLOUDOWNERHASHEDPERSONID
FROM { asset_table }
JOIN ZADDITIONALASSETATTRIBUTES ON ZADDITIONALASSETATTRIBUTES.ZASSET = { asset_table } .Z_PK
ORDER BY { asset_table } .ZUUID """
@@ -2010,6 +2014,7 @@
# 40 ZGENERICASSET.ZSAVEDASSETTYPE -- how item imported
# 41 ZGENERICASSET.ZADDEDDATE -- date item added to the library
# 42 ZGENERICASSET.Z_PK -- primary key
+
# 43 ZGENERICASSET.ZCLOUDOWNERHASHEDPERSONID -- used to look up owner name (for shared photos)
for row in c :
uuid = row [ 0 ]
@@ -2195,6 +2200,7 @@
info [ "added_date" ] = datetime ( 1970 , 1 , 1 )
info [ "pk" ] = row [ 42 ]
+
info [ "cloudownerhashedpersonid" ] = row [ 43 ]
# initialize import session info which will be filled in later
# not every photo has an import session so initialize all records now
diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js
index 5bca2af5..9de934b2 100644
--- a/docs/_static/documentation_options.js
+++ b/docs/_static/documentation_options.js
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
- VERSION: '0.42.86',
+ VERSION: '0.42.87',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/docs/cli.html b/docs/cli.html
index 5521337c..e6ce20df 100644
--- a/docs/cli.html
+++ b/docs/cli.html
@@ -5,7 +5,7 @@
-
osxphotos command line interface (CLI) — osxphotos 0.42.86 documentation
+
osxphotos command line interface (CLI) — osxphotos 0.42.87 documentation
diff --git a/docs/genindex.html b/docs/genindex.html
index 88d18a26..324dbeea 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -5,7 +5,7 @@
-
Index — osxphotos 0.42.86 documentation
+
Index — osxphotos 0.42.87 documentation
diff --git a/docs/index.html b/docs/index.html
index 8001492c..fb1dc6f9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,7 +5,7 @@
-
Welcome to osxphotos’s documentation! — osxphotos 0.42.86 documentation
+
Welcome to osxphotos’s documentation! — osxphotos 0.42.87 documentation
diff --git a/docs/modules.html b/docs/modules.html
index 14cd5311..80a093ba 100644
--- a/docs/modules.html
+++ b/docs/modules.html
@@ -5,7 +5,7 @@
-
osxphotos — osxphotos 0.42.86 documentation
+
osxphotos — osxphotos 0.42.87 documentation
diff --git a/docs/reference.html b/docs/reference.html
index 48e39a4c..ff368ee9 100644
--- a/docs/reference.html
+++ b/docs/reference.html
@@ -5,7 +5,7 @@
-
osxphotos package — osxphotos 0.42.86 documentation
+
osxphotos package — osxphotos 0.42.87 documentation
diff --git a/docs/search.html b/docs/search.html
index 5aa51230..9829041b 100644
--- a/docs/search.html
+++ b/docs/search.html
@@ -5,7 +5,7 @@
-
Search — osxphotos 0.42.86 documentation
+
Search — osxphotos 0.42.87 documentation
diff --git a/osxphotos/_version.py b/osxphotos/_version.py
index c24507ab..60552e79 100644
--- a/osxphotos/_version.py
+++ b/osxphotos/_version.py
@@ -1,4 +1,4 @@
""" version info """
-__version__ = "0.42.86"
+__version__ = "0.42.87"
diff --git a/osxphotos/photoinfo/photoinfo.py b/osxphotos/photoinfo/photoinfo.py
index 2feda318..0d9596cb 100644
--- a/osxphotos/photoinfo/photoinfo.py
+++ b/osxphotos/photoinfo/photoinfo.py
@@ -1108,11 +1108,15 @@ class PhotoInfo:
try:
return self._owner
except AttributeError:
- query = get_query(
- "shared_owner", photos_ver=self._db._photos_ver, uuid=self.uuid
- )
- result = self._db.execute(query).fetchone()
- self._owner = result[0] if result else None
+ try:
+ personid = self._info["cloudownerhashedpersonid"]
+ self._owner = (
+ self._db._db_hashed_person_id[personid]["full_name"]
+ if personid
+ else None
+ )
+ except KeyError:
+ self._owner = None
return self._owner
def render_template(
diff --git a/osxphotos/photosdb/photosdb.py b/osxphotos/photosdb/photosdb.py
index dd5d887b..281c8066 100644
--- a/osxphotos/photosdb/photosdb.py
+++ b/osxphotos/photosdb/photosdb.py
@@ -1199,6 +1199,9 @@ class PhotosDB:
self._dbphotos[uuid]["import_uuid"] = row[44]
self._dbphotos[uuid]["fok_import_session"] = None
+ # photos 5+ only, for shared photos
+ self._dbphotos[uuid]["cloudownerhashedpersonid"] = None
+
# compute signatures for finding possible duplicates
signature = self._duplicate_signature(uuid)
try:
@@ -1927,7 +1930,8 @@ class PhotosDB:
{asset_table}.ZTRASHEDDATE,
{asset_table}.ZSAVEDASSETTYPE,
{asset_table}.ZADDEDDATE,
- {asset_table}.Z_PK
+ {asset_table}.Z_PK,
+ {asset_table}.ZCLOUDOWNERHASHEDPERSONID
FROM {asset_table}
JOIN ZADDITIONALASSETATTRIBUTES ON ZADDITIONALASSETATTRIBUTES.ZASSET = {asset_table}.Z_PK
ORDER BY {asset_table}.ZUUID """
@@ -1977,6 +1981,7 @@ class PhotosDB:
# 40 ZGENERICASSET.ZSAVEDASSETTYPE -- how item imported
# 41 ZGENERICASSET.ZADDEDDATE -- date item added to the library
# 42 ZGENERICASSET.Z_PK -- primary key
+ # 43 ZGENERICASSET.ZCLOUDOWNERHASHEDPERSONID -- used to look up owner name (for shared photos)
for row in c:
uuid = row[0]
@@ -2162,6 +2167,7 @@ class PhotosDB:
info["added_date"] = datetime(1970, 1, 1)
info["pk"] = row[42]
+ info["cloudownerhashedpersonid"] = row[43]
# initialize import session info which will be filled in later
# not every photo has an import session so initialize all records now