Skip to content

Commit c1bf5fe

Browse files
luqasnmandarons
authored andcommitted
Handle special folders after normal folders so they get precedence
because otherwise a normal folder with the same name will shadow the special folder.
1 parent 107130f commit c1bf5fe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

icloudpy/services/photos.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ def albums(self):
169169
"""Returns photo albums."""
170170
if not self._albums:
171171
self._albums = {}
172-
for (name, props) in self.SMART_FOLDERS.items():
173-
self._albums[name] = PhotoAlbum(self, name, **props)
174172

175173
for folder in self._fetch_folders():
176174

@@ -191,6 +189,7 @@ def albums(self):
191189
folder_name = base64.b64decode(
192190
folder["fields"]["albumNameEnc"]["value"]
193191
).decode("utf-8")
192+
194193
query_filter = [
195194
{
196195
"fieldName": "parentId",
@@ -210,6 +209,9 @@ def albums(self):
210209
)
211210
self._albums[folder_name] = album
212211

212+
for (name, props) in self.SMART_FOLDERS.items():
213+
self._albums[name] = PhotoAlbum(self, name, **props)
214+
213215
return self._albums
214216

215217
def _fetch_folders(self):

0 commit comments

Comments
 (0)