Bug memory leak 1047 (#1052)

* Fix for memory leak, #1047

* Refactored photos_by_uuid, AlbumInfo.asdict for speed optimization

* Fix for huge crash log, #1048

* Fix for error on export #1046

* add rajscode as a contributor for bug (#1049)

* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* add wernerzj as a contributor for bug (#1050)

* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Rhet Turnbull <rturnbull@gmail.com>

* Fixed all-contributors badge

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
This commit is contained in:
Rhet Turnbull
2023-04-10 16:50:17 -07:00
committed by GitHub
parent 6f88f19950
commit 956cecfa30
7 changed files with 111 additions and 157 deletions

View File

@@ -1497,7 +1497,7 @@ def test_json(photosdb: osxphotos.PhotosDB):
def test_json_indent(photosdb: osxphotos.PhotosDB):
"""Test PhotoInfo.json() with indent"""
photo = photosdb.get_photo(UUID_DICT["favorite"])
photo_dict = json.loads(photo.json(indent=4))
photo_dict = json.loads(photo.json(indent=4, shallow=False))
assert photo_dict["favorite"]
assert "album_info" in photo_dict

View File

@@ -1285,7 +1285,7 @@ def test_json(photosdb: osxphotos.PhotosDB):
def test_json_indent(photosdb: osxphotos.PhotosDB):
"""Test PhotoInfo.json() with indent"""
photo = photosdb.get_photo(UUID_DICT["favorite"])
photo_dict = json.loads(photo.json(indent=4))
photo_dict = json.loads(photo.json(indent=4, shallow=False))
assert photo_dict["favorite"]
assert "album_info" in photo_dict
@@ -1296,3 +1296,11 @@ def test_json_shallow(photosdb: osxphotos.PhotosDB):
photo_dict = json.loads(photo.json(shallow=True))
assert photo_dict["favorite"]
assert "album_info" not in photo_dict
def test_photosdb_photos_by_uuid(photosdb: osxphotos.PhotosDB):
"""Test PhotosDB.photos_by_uuid"""
photos = photosdb.photos_by_uuid(UUID_DICT.values())
assert len(photos) == len(UUID_DICT)
for photo in photos:
assert photo.uuid in UUID_DICT.values()