Skip to content

Commit

Permalink
get_children: allow method to work on non-container items
Browse files Browse the repository at this point in the history
This unblocks removing movies with `smugcli rm`, which helped me while
I was debugging duplicated movies resulting from #21.
  • Loading branch information
durin42 authored and graveljp committed Oct 30, 2022
1 parent 4d017e7 commit 4297ef5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions smugcli/smugmug.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ def __hash__(self):
def get_children(self, params=None) -> NodeList:
"""Get the children list of this node."""
if 'Type' not in self._json:
if 'FileName' in self._json:
# it's a single image, which has no children
return []
raise UnexpectedResponseError('Node does not have a "Type" attribute.')

params = params or {}
Expand Down

0 comments on commit 4297ef5

Please # to comment.