diff --git a/CHANGELOG.md b/CHANGELOG.md index ce90cc93a..2813b4146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- fix: disambiguate whole photo collection from the album with `All Photos` name [#1077](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/1077) + ## 1.27.0 (2025-02-22) - feature: list and download from shared libraries for invitee [#947](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/947) diff --git a/docs/reference.md b/docs/reference.md index c4a6c7bb3..667dfd903 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -31,7 +31,7 @@ This is a list of all options available for command line interface (CLI) of the : Specifies what Album to download. - Default: "All Photos" - Special album where all assets are automatically added. + When not specified, the whole asset collection is considered. ```{note} Only one album can be downloaded by `icloudpd` diff --git a/src/icloudpd/base.py b/src/icloudpd/base.py index 381b32156..281513fab 100644 --- a/src/icloudpd/base.py +++ b/src/icloudpd/base.py @@ -346,9 +346,8 @@ def report_version(ctx: click.Context, _param: click.Parameter, value: bool) -> @click.option( "-a", "--album", - help="Album to download (default: All Photos)", + help="Album to download or whole collection if not specified", metavar="", - default="All Photos", ) @click.option( "-l", @@ -589,7 +588,7 @@ def main( live_photo_size: LivePhotoVersionSize, recent: Optional[int], until_found: Optional[int], - album: str, + album: Optional[str], list_albums: bool, library: str, list_libraries: bool, @@ -1168,7 +1167,7 @@ def core( primary_sizes: Sequence[AssetVersionSize], recent: Optional[int], until_found: Optional[int], - album: str, + album: Optional[str], list_albums: bool, library: str, list_libraries: bool, @@ -1258,8 +1257,6 @@ def core( else: while True: - # Default album is "All Photos", so this is the same as - # calling `icloud.photos.all`. # After 6 or 7 runs within 1h Apple blocks the API for some time. In that # case exit. try: @@ -1271,7 +1268,7 @@ def core( else: logger.error("Unknown library: %s", library) return 1 - photos = library_object.albums[album] + photos = library_object.albums[album] if album else library_object.all except PyiCloudAPIResponseException as err: # For later: come up with a nicer message to the user. For now take the # exception text @@ -1290,7 +1287,8 @@ def core( directory = os.path.normpath(cast(str, directory)) videos_phrase = "" if skip_videos else " and videos" - logger.debug("Looking up all photos%s from album %s...", videos_phrase, album) + album_phrase = f" from album {album}" if album else "" + logger.debug(f"Looking up all photos{videos_phrase}{album_phrase}...") session_exception_handler = session_error_handle_builder(logger, icloud) internal_error_handler = internal_error_handle_builder(logger) diff --git a/src/icloudpd/config.py b/src/icloudpd/config.py index 874bac87c..17cfe6fec 100644 --- a/src/icloudpd/config.py +++ b/src/icloudpd/config.py @@ -17,7 +17,7 @@ def __init__( live_photo_size: LivePhotoVersionSize, recent: Optional[int], until_found: Optional[int], - album: str, + album: Optional[str], list_albums: bool, library: str, list_libraries: bool, diff --git a/src/pyicloud_ipd/services/photos.py b/src/pyicloud_ipd/services/photos.py index 94f8ab49f..c47917f33 100644 --- a/src/pyicloud_ipd/services/photos.py +++ b/src/pyicloud_ipd/services/photos.py @@ -36,13 +36,13 @@ class PhotoLibrary(object): This provides access to all the albums as well as the photos. """ - SMART_FOLDERS = { - "All Photos": { + WHOLE_COLLECTION = { "obj_type": "CPLAssetByAssetDateWithoutHiddenOrDeleted", "list_type": "CPLAssetAndMasterByAssetDateWithoutHiddenOrDeleted", "direction": "ASCENDING", "query_filter": None - }, + } + SMART_FOLDERS = { "Time-lapse": { "obj_type": "CPLAssetInSmartAlbumByAssetDate:Timelapse", "list_type": "CPLAssetAndMasterInSmartAlbumByAssetDate", @@ -161,6 +161,7 @@ def __init__(self, service: "PhotosService", zone_id: Dict[str, Any], library_ty self.service_endpoint = self.service.get_service_endpoint(library_type) self._albums: Optional[Dict[str, PhotoAlbum]] = None + self._all: Optional[PhotoAlbum] = None url = ('%s/records/query?%s' % (self.service_endpoint, urlencode(self.service.params))) @@ -240,7 +241,11 @@ def _fetch_folders(self) -> Sequence[Dict[str, Any]]: @property def all(self) -> "PhotoAlbum": - return self.albums['All Photos'] + if not self._all: + self._all = PhotoAlbum(self.service, self.service_endpoint, "", zone_id=self.zone_id, **self.WHOLE_COLLECTION) # type: ignore[arg-type] # dynamically builing params + # need to pull all albums because existing recorded tests expect all albums to be pulled... + self.albums + return self._all class PhotosService(PhotoLibrary): diff --git a/tests/test_autodelete_photos.py b/tests/test_autodelete_photos.py index 7080991ed..0e1f732b2 100644 --- a/tests/test_autodelete_photos.py +++ b/tests/test_autodelete_photos.py @@ -75,7 +75,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -122,7 +122,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -182,7 +182,7 @@ def test_download_autodelete_photos(self) -> None: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -225,7 +225,7 @@ def test_download_autodelete_photos(self) -> None: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -311,9 +311,7 @@ def test_autodelete_photos(self) -> None: cookie_dir, ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 0 original photos to {data_dir} ...", self._caplog.text, @@ -424,7 +422,7 @@ def mocked_authenticate(self: PyiCloudService) -> None: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -519,7 +517,7 @@ def mocked_authenticate(self: PyiCloudService) -> None: print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -606,7 +604,7 @@ def mock_raise_response_error( print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -687,7 +685,7 @@ def mock_raise_response_error( print_result_exception(result) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -791,9 +789,7 @@ def test_autodelete_photos_dry_run(self) -> None: ) print_result_exception(result) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 0 original photos to {data_dir} ...", self._caplog.text, @@ -891,9 +887,7 @@ def test_autodelete_photos_folder_none(self) -> None: cookie_dir, ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 0 original photos to {data_dir} ...", self._caplog.text, @@ -988,9 +982,7 @@ def test_autodelete_photos_lp(self) -> None: cookie_dir, ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 0 original photos to {data_dir} ...", self._caplog.text, @@ -1085,9 +1077,7 @@ def test_autodelete_photos_lp_heic(self) -> None: cookie_dir, ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 0 original photos to {data_dir} ...", self._caplog.text, diff --git a/tests/test_download_live_photos.py b/tests/test_download_live_photos.py index 9400a5e85..6b8250de9 100644 --- a/tests/test_download_live_photos.py +++ b/tests/test_download_live_photos.py @@ -100,9 +100,7 @@ def test_skip_existing_live_photodownloads(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos and videos...", self._caplog.text) self.assertIn( f"INFO Downloading 3 original photos and videos to {data_dir} ...", self._caplog.text, diff --git a/tests/test_download_live_photos_id.py b/tests/test_download_live_photos_id.py index 31bb50b3d..b9b4b1f09 100644 --- a/tests/test_download_live_photos_id.py +++ b/tests/test_download_live_photos_id.py @@ -88,9 +88,7 @@ def test_skip_existing_live_photodownloads_name_id7(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos and videos...", self._caplog.text) self.assertIn( f"INFO Downloading 3 original photos and videos to {data_dir} ...", self._caplog.text, diff --git a/tests/test_download_photos.py b/tests/test_download_photos.py index 867855b94..9f81f28c1 100644 --- a/tests/test_download_photos.py +++ b/tests/test_download_photos.py @@ -77,7 +77,7 @@ def test_download_and_skip_existing_photos(self) -> None: assert result.exit_code == 0 - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -173,7 +173,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: assert result.exit_code == 0 self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -228,7 +228,7 @@ def test_download_photos_and_get_exif_exceptions(self) -> None: ) assert result.exit_code == 0 - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -278,9 +278,7 @@ def test_skip_existing_downloads(self) -> None: ) assert result.exit_code == 0 - self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos and videos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo or video to {data_dir} ...", self._caplog.text, @@ -369,7 +367,7 @@ def test_until_found(self) -> None: dp_patched.assert_has_calls(expected_calls) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -420,9 +418,7 @@ def test_handle_io_error(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -673,7 +669,7 @@ def test_missing_size(self) -> None: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -750,7 +746,7 @@ def test_size_fallback_to_original(self) -> None: ], ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -810,7 +806,7 @@ def test_force_size(self) -> None: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -866,7 +862,7 @@ def test_download_two_sizes_with_force_size(self) -> None: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -926,7 +922,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -982,7 +978,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1106,9 +1102,7 @@ def mocked_download(self: PhotoAsset, _url: str) -> Response: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -1188,9 +1182,7 @@ def test_download_photos_and_set_exif_exceptions(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1240,7 +1232,7 @@ def test_download_chinese(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1305,7 +1297,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1362,7 +1354,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1404,9 +1396,7 @@ def test_download_and_delete_after(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1448,9 +1438,7 @@ def test_download_and_not_delete_after_when_exists(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1486,7 +1474,7 @@ def test_download_and_delete_after_fail(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1529,7 +1517,7 @@ def test_download_over_old_original_photos(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -1808,9 +1796,7 @@ def test_handle_io_error_mkdir(self) -> None: ) print_result_exception(result) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1852,7 +1838,7 @@ def test_dry_run(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) # self.assertIn( # f"INFO Downloading 2 original photos to {data_dir} ...", # self._caplog.text, @@ -1908,9 +1894,7 @@ def raise_response_error( ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1952,7 +1936,7 @@ def test_download_raw_photos(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1995,7 +1979,7 @@ def test_download_two_sizes(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original,thumb photo to {data_dir} ...", self._caplog.text, @@ -2045,7 +2029,7 @@ def test_download_raw_alt_photos(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original,alternative photo to {data_dir} ...", self._caplog.text, @@ -2093,7 +2077,7 @@ def test_download_raw_photos_policy_alt_with_adj(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first adjusted photo to {data_dir} ...", self._caplog.text, @@ -2143,7 +2127,7 @@ def test_download_raw_photos_policy_orig(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -2193,7 +2177,7 @@ def test_download_raw_photos_policy_as_is(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -2345,12 +2329,10 @@ def test_download_from_shared_library(self) -> None: "--no-progress-bar", ], ) - + self.assertEqual(result.exit_code, 0) - self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos and videos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo or video to {data_dir} ...", self._caplog.text, diff --git a/tests/test_download_photos_id.py b/tests/test_download_photos_id.py index 6c49fc9ca..2df8f8e81 100644 --- a/tests/test_download_photos_id.py +++ b/tests/test_download_photos_id.py @@ -78,7 +78,7 @@ def test_download_and_skip_existing_photos_name_id7(self) -> None: assert result.exit_code == 0 - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -174,7 +174,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: assert result.exit_code == 0 self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -229,7 +229,7 @@ def test_download_photos_and_get_exif_exceptions_name_id7(self) -> None: ) assert result.exit_code == 0 - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -279,9 +279,7 @@ def test_skip_existing_downloads_name_id7(self) -> None: ) assert result.exit_code == 0 - self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos and videos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo or video to {data_dir} ...", self._caplog.text, @@ -370,7 +368,7 @@ def test_until_found_name_id7(self) -> None: dp_patched.assert_has_calls(expected_calls) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -421,9 +419,7 @@ def test_handle_io_error_name_id7(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -674,7 +670,7 @@ def test_missing_size_name_id7(self) -> None: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -763,7 +759,7 @@ def test_size_fallback_to_original_name_id7(self) -> None: ], ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -823,7 +819,7 @@ def test_force_size_name_id7(self) -> None: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -875,7 +871,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -931,7 +927,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1057,9 +1053,7 @@ def mocked_download(self: PhotoAsset, _url: str) -> Response: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -1112,9 +1106,7 @@ def test_download_photos_and_set_exif_exceptions_name_id7(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1164,7 +1156,7 @@ def test_download_chinese_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1229,7 +1221,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1286,7 +1278,7 @@ def mocked_download(pa: PhotoAsset, _url: str) -> Response: ) self.assertIn( - "DEBUG Looking up all photos and videos from album All Photos...", + "DEBUG Looking up all photos and videos...", self._caplog.text, ) self.assertIn( @@ -1328,9 +1320,7 @@ def test_download_and_delete_after_name_id7(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1374,9 +1364,7 @@ def test_download_and_not_delete_after_when_exists_name_id7(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1414,7 +1402,7 @@ def test_download_and_delete_after_fail_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1457,7 +1445,7 @@ def test_download_over_old_original_photos_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 5 original photos to {data_dir} ...", self._caplog.text, @@ -1736,9 +1724,7 @@ def test_handle_io_error_mkdir_name_id7(self) -> None: ) print_result_exception(result) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1780,7 +1766,7 @@ def test_dry_run_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) # self.assertIn( # f"INFO Downloading 2 original photos to {data_dir} ...", # self._caplog.text, @@ -1836,9 +1822,7 @@ def raise_response_error( ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1881,7 +1865,7 @@ def test_download_raw_photos_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -1927,7 +1911,7 @@ def test_download_two_sizes_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original,thumb photo to {data_dir} ...", self._caplog.text, @@ -1977,7 +1961,7 @@ def test_download_raw_alt_photos_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original,alternative photo to {data_dir} ...", self._caplog.text, @@ -2025,7 +2009,7 @@ def test_download_raw_photos_policy_alt_with_adj_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first adjusted photo to {data_dir} ...", self._caplog.text, @@ -2075,7 +2059,7 @@ def test_download_raw_photos_policy_orig_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -2125,7 +2109,7 @@ def test_download_raw_photos_policy_as_is_name_id7(self) -> None: ], ) - self.assertIn("DEBUG Looking up all photos from album All Photos...", self._caplog.text) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, diff --git a/tests/test_keep_icloud_mode.py b/tests/test_keep_icloud_mode.py index 7dab0338e..69031ca1d 100644 --- a/tests/test_keep_icloud_mode.py +++ b/tests/test_keep_icloud_mode.py @@ -52,9 +52,7 @@ def test_wide_range_keep_icloud_recent_days(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -98,9 +96,7 @@ def test_narrow_range_keep_icloud_recent_days(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -145,9 +141,7 @@ def test_keep_icloud_recent_days_delete_all(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -191,9 +185,7 @@ def test_keep_icloud_recent_days_1_keeps_today(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, @@ -241,9 +233,7 @@ def test_keep_icloud_recent_days_delete_existing(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 3 original photos to {data_dir} ...", self._caplog.text, @@ -299,9 +289,7 @@ def test_keep_icloud_recent_days_keeps_some(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading 3 original photos to {data_dir} ...", self._caplog.text, @@ -355,9 +343,7 @@ def test_keep_icloud_recent_days_delete_existing_dry_run(self) -> None: ], ) - self.assertIn( - "DEBUG Looking up all photos from album All Photos...", self._caplog.text - ) + self.assertIn("DEBUG Looking up all photos...", self._caplog.text) self.assertIn( f"INFO Downloading the first original photo to {data_dir} ...", self._caplog.text, diff --git a/tests/test_listing_albums.py b/tests/test_listing_albums.py index 06632e657..3821bf484 100644 --- a/tests/test_listing_albums.py +++ b/tests/test_listing_albums.py @@ -53,7 +53,6 @@ def test_listing_albums(self) -> None: print_result_exception(result) albums = result.output.splitlines() - self.assertIn("All Photos", albums) self.assertIn("WhatsApp", albums) self.assertIn("Time-lapse", albums) self.assertIn("Recently Deleted", albums)