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 graveljp#21.
  • Loading branch information
durin42 committed Jul 24, 2021
1 parent d8028fe commit 10eb269
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 @@ -206,6 +206,9 @@ def __hash__(self):

def get_children(self, params=None):
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 10eb269

Please sign in to comment.