From 4297ef5b1f1e8c1408b5a7a4b897f213087866ac Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Sat, 24 Jul 2021 19:08:45 -0400 Subject: [PATCH] get_children: allow method to work on non-container items This unblocks removing movies with `smugcli rm`, which helped me while I was debugging duplicated movies resulting from #21. --- smugcli/smugmug.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smugcli/smugmug.py b/smugcli/smugmug.py index 415b4d3..014087c 100644 --- a/smugcli/smugmug.py +++ b/smugcli/smugmug.py @@ -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 {}