Fix for json() failing on photos in projects, #999 (#1039)

This commit is contained in:
Rhet Turnbull 2023-04-08 09:49:31 -07:00 committed by GitHub
parent adac985309
commit f4a743468d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -386,7 +386,25 @@ class ProjectInfo(AlbumInfo):
Projects are cards, calendars, slideshows, etc.
"""
...
@property
def folder_names(self):
"""Return hierarchical list of folders the album is contained in
the folder list is in form:
["Top level folder", "sub folder 1", "sub folder 2", ...]
or empty list if album is not in any folders
"""
# projects are not in folders
return []
@property
def folder_list(self):
"""Returns list of FolderInfo objects for each folder the album is contained in
or empty list if album is not in any folders
"""
# projects are not in folders
return []
class FolderInfo:

View File

@ -149,3 +149,11 @@ def test_photoinfo_project_info(photosdb, uuid, expected_projects):
project_names = [p.title for p in photo.project_info]
assert sorted(project_names) == sorted(expected_projects)
@pytest.mark.parametrize("uuid,expected_projects", PHOTO_PROJECTS.items())
def test_photoinfo_project_info_asdict(photosdb, uuid, expected_projects):
"""Test PhotoInfo.project_info.asdict() #999"""
photo = photosdb.get_photo(uuid)
for p in photo.project_info:
assert p.asdict()