Skip to content

Commit

Permalink
Support for Sequoia beta 2
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Jul 18, 2024
1 parent caff2db commit 4f8710c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
22 changes: 20 additions & 2 deletions osxphotos/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
_PHOTOS_7_MODEL_VERSION = [15000, 15999] # Dev preview: 15134, 12.1: 15331
_PHOTOS_8_MODEL_VERSION = [16000, 16999] # Ventura dev preview: 16119
_PHOTOS_9_MODEL_VERSION = [17000, 17999] # Sonoma dev preview: 17120
_PHOTOS_10_MODEL_VERSION = [18000, 18999] # Sequoia dev preview: 18164
_PHOTOS_10B1_MODEL_VERSION = [18000, 18164] # Sequoia dev preview 1: 18164
_PHOTOS_10_MODEL_VERSION = [18165, 18999]

# the preview versions of 12.0.0 had a difference schema for syndication info so need to check model version before processing
_PHOTOS_SYNDICATION_MODEL_VERSION = 15323 # 12.0.1
Expand Down Expand Up @@ -143,7 +144,7 @@
"MASTER_FINGERPRINT": "ZADDITIONALASSETATTRIBUTES.ZMASTERFINGERPRINT",
"HAS_ADJUSTMENTS": "ZASSET.ZHASADJUSTMENTS",
},
10: {
9.9: {
"ASSET": "ZASSET",
"KEYWORD_JOIN": "Z_1KEYWORDS.Z_48KEYWORDS",
"ALBUM_JOIN": "Z_31ASSETS.Z_3ASSETS",
Expand All @@ -159,6 +160,22 @@
"MASTER_FINGERPRINT": "ZADDITIONALASSETATTRIBUTES.ZORIGINALSTABLEHASH",
"HAS_ADJUSTMENTS": "ZASSET.ZADJUSTMENTSSTATE",
},
10: {
"ASSET": "ZASSET",
"KEYWORD_JOIN": "Z_1KEYWORDS.Z_48KEYWORDS",
"ALBUM_JOIN": "Z_30ASSETS.Z_3ASSETS",
"ALBUM_SORT_ORDER": "Z_30ASSETS.Z_FOK_3ASSETS",
"IMPORT_FOK": "null",
"DEPTH_STATE": "ZASSET.ZDEPTHTYPE",
"UTI_ORIGINAL": "ZINTERNALRESOURCE.ZCOMPACTUTI",
"ASSET_ALBUM_JOIN": "Z_30ASSETS.Z_30ALBUMS",
"ASSET_ALBUM_TABLE": "Z_30ASSETS",
"HDR_TYPE": "ZHDRTYPE",
"DETECTED_FACE_PERSON_FK": "ZDETECTEDFACE.ZPERSONFORFACE",
"DETECTED_FACE_ASSET_FK": "ZDETECTEDFACE.ZASSETFORFACE",
"MASTER_FINGERPRINT": "ZADDITIONALASSETATTRIBUTES.ZORIGINALSTABLEHASH",
"HAS_ADJUSTMENTS": "ZASSET.ZADJUSTMENTSSTATE",
},
}

# Which version operating systems have been tested
Expand Down Expand Up @@ -205,6 +222,7 @@
("14", "2"),
("14", "3"),
("14", "4"),
("14", "5"),
]

# Photos 5 has persons who are empty string if unidentified face
Expand Down
3 changes: 3 additions & 0 deletions osxphotos/photosdb/photosdb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
_PHOTOS_8_MODEL_VERSION,
_PHOTOS_9_MODEL_VERSION,
_PHOTOS_10_MODEL_VERSION,
_PHOTOS_10B1_MODEL_VERSION,
_TESTED_DB_VERSIONS,
)
from ..sqlite_utils import sqlite_open_ro
Expand Down Expand Up @@ -136,6 +137,8 @@ def get_photos_version_from_model(db_file: str) -> int:
return 8
if _PHOTOS_9_MODEL_VERSION[0] <= model_ver <= _PHOTOS_9_MODEL_VERSION[1]:
return 9
if _PHOTOS_10B1_MODEL_VERSION[0] <= model_ver <= _PHOTOS_10B1_MODEL_VERSION[1]:
return 9.9
if _PHOTOS_10_MODEL_VERSION[0] <= model_ver <= _PHOTOS_10_MODEL_VERSION[1]:
return 10
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sequoia_15_0_0_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def test_db_version(photosdb):


def test_photos_version(photosdb):
assert photosdb.photos_version == 10
assert photosdb.photos_version == 9.9 # dev preview 1 isn't version 10 yet


def test_persons(photosdb):
Expand Down

0 comments on commit 4f8710c

Please sign in to comment.