diff --git a/openphoto/objects.py b/openphoto/objects.py index d85a780..78af7be 100644 --- a/openphoto/objects.py +++ b/openphoto/objects.py @@ -87,13 +87,23 @@ class Photo(OpenPhotoObject): **kwds)["result"] value = {} if "next" in result: + # Workaround for APIv1 + if not isinstance(result["next"], list): + result["next"] = [result["next"]] + value["next"] = [] for photo in result["next"]: value["next"].append(Photo(self._openphoto, photo)) + if "previous" in result: + # Workaround for APIv1 + if not isinstance(result["previous"], list): + result["previous"] = [result["previous"]] + value["previous"] = [] for photo in result["previous"]: value["previous"].append(Photo(self._openphoto, photo)) + return value def transform(self, **kwds):