Feature person favorite 940 (#950)

* Added person favorite for #940

* Added person.feature_less #940 (but not 100% sure it's right yet)

* Added tests for PersonInfo.favorite, PersonInfo.feature_less
This commit is contained in:
Rhet Turnbull
2023-01-22 11:53:08 -08:00
committed by GitHub
parent 381141bc09
commit 29968269ff
20 changed files with 184 additions and 94 deletions

View File

@@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>hostname</key>
<string>ddrucker-mba.local</string>
<string>Mac-mini.local</string>
<key>hostuuid</key>
<string>3C58BD83-C174-52E3-B12D-D7EBDED55622</string>
<string>8E774325-0506-5746-9991-6B8189271107</string>
<key>pid</key>
<integer>940</integer>
<integer>61681</integer>
<key>processname</key>
<string>photolibraryd</string>
<key>uid</key>
<integer>502</integer>
<integer>501</integer>
</dict>
</plist>

View File

@@ -17,6 +17,15 @@
<key>kZoomLevelIdentifierPhotosGrid</key>
<integer>1</integer>
</dict>
<key>PXPeopleCandidateWidgetKey</key>
<dict>
<key>PXPeopleCandidateWidgetKey2023.01.22</key>
<array>
<string>3DDC8F83-FDAB-4943-AE53-19428BEEED9D/L0/070</string>
</array>
</dict>
<key>PXPeopleHomeSortingType</key>
<integer>0</integer>
<key>Photos</key>
<dict>
<key>CollapsedSidebarSectionIdentifiers</key>

View File

@@ -902,13 +902,15 @@
<key>lastSeenDates</key>
<dict>
<key>com.apple.photos.CPAnalytics.assetCollectionViewed</key>
<string>11/12/22</string>
<string>1/22/23</string>
<key>com.apple.photos.CPAnalytics.mediaViewed</key>
<string>11/12/22</string>
<string>1/22/23</string>
<key>com.apple.photos.CPAnalytics.search.session</key>
<string>11/12/22</string>
<key>screen_CuratedLibrary_AllPhotos</key>
<string>11/12/22</string>
<string>1/22/23</string>
<key>screen_PhotosDetails_People</key>
<string>1/22/23</string>
<key>screen_PhotosView</key>
<string>11/12/22</string>
</dict>

View File

@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PLThumbnailManagerRebuildingTablesOnly</key>
<true/>
<key>PLThumbnailManagerThumbnailFormatKey</key>
<integer>5005</integer>
<key>PLThumbnailManagerThumbnailFormatsKey</key>

View File

@@ -40,6 +40,9 @@ JSON_DICT = {
"keyface": 2,
"facecount": 3,
"keyphoto": "F12384F6-CD17-4151-ACBA-AE0E3688539E",
"favorite": False,
"sort_order": 3,
"feature_less": False,
},
"katie_4": {
"uuid": "D%zgor6TRmGng5V75UBy5A",
@@ -48,6 +51,9 @@ JSON_DICT = {
"keyface": 7,
"facecount": 3,
"keyphoto": "8SOE9s0XQVGsuq4ONohTng",
"favorite": False,
"sort_order": 0,
"feature_less": False,
},
}
@@ -67,7 +73,7 @@ def photosdb4():
def test_person_info_photosdb_v5(photosdb5):
""" Test PersonInfo object """
"""Test PersonInfo object"""
import json
test_key = "katie_5"
@@ -85,7 +91,7 @@ def test_person_info_photosdb_v5(photosdb5):
def test_person_info_photosinfo_v5(photosdb5):
""" Test PersonInfo object """
"""Test PersonInfo object"""
import json
test_key = "katie_5"
@@ -110,7 +116,7 @@ def test_person_info_photosinfo_v5(photosdb5):
def test_person_info_photosdb_v4(photosdb4):
""" Test PersonInfo object """
"""Test PersonInfo object"""
import json
test_key = "katie_4"
@@ -128,7 +134,7 @@ def test_person_info_photosdb_v4(photosdb4):
def test_person_info_photosinfo_v4(photosdb4):
""" Test PersonInfo object """
"""Test PersonInfo object"""
import json
test_key = "katie_4"

View File

@@ -240,6 +240,11 @@ UUID_FINGERPRINT = {
"E9BC5C36-7CD1-40A1-A72B-8B8FAC227D51": "ASs96bJvsunOg9Vxo5hK7VU3HegE"
}
UUID_FAVORITE_PERSON = "E9BC5C36-7CD1-40A1-A72B-8B8FAC227D51" # wedding.jpg, Maria
UUID_NOT_FAVORITE_PERSON = "D79B8D77-BFFC-460B-9312-034F2877D35B" # Pumkins2.jpg, Katie
UUID_PERSON_FEATURE_LESS = UUID_NOT_FAVORITE_PERSON
UUID_PERSON_NOT_FEATURE_LESS = UUID_FAVORITE_PERSON
@pytest.fixture(scope="module")
def photosdb():
@@ -1250,3 +1255,21 @@ def test_fingerprint(photosdb):
for uuid, fingerprint in UUID_FINGERPRINT.items():
photo = photosdb.get_photo(uuid)
assert photo.fingerprint == fingerprint
def test_person_favorite(photosdb):
"""Test person favorite"""
photo = photosdb.get_photo(UUID_FAVORITE_PERSON)
assert photo.person_info[0].favorite
photo = photosdb.get_photo(UUID_NOT_FAVORITE_PERSON)
assert not photo.person_info[0].favorite
def test_person_feature_less(photosdb):
"""Test person feature less"""
photo = photosdb.get_photo(UUID_PERSON_FEATURE_LESS)
assert photo.person_info[0].feature_less
photo = photosdb.get_photo(UUID_PERSON_NOT_FEATURE_LESS)
assert not photo.person_info[0].feature_less