From 6af4bfae21f00b11a5ae8a91b6a5c6990f84f7b4 Mon Sep 17 00:00:00 2001 From: Hank G Date: Tue, 13 Dec 2022 16:46:16 -0500 Subject: [PATCH] Update src/Module/Api/Friendica/Photoalbum/Show.php Co-authored-by: Hypolite Petovan --- src/Module/Api/Friendica/Photoalbum/Show.php | 22 +++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Module/Api/Friendica/Photoalbum/Show.php b/src/Module/Api/Friendica/Photoalbum/Show.php index 485b3e91e7..14f561a990 100644 --- a/src/Module/Api/Friendica/Photoalbum/Show.php +++ b/src/Module/Api/Friendica/Photoalbum/Show.php @@ -90,20 +90,18 @@ class Show extends BaseApi $photos = Photo::selectToArray(['resource-id'], $condition, $params); $data = ['photo' => []]; - if (DBA::isResult($photos)) { - foreach ($photos as $photo) { - $element = $this->friendicaPhoto->createFromId($photo['resource-id'], null, $uid, 'json', false); + foreach ($photos as $photo) { + $element = $this->friendicaPhoto->createFromId($photo['resource-id'], null, $uid, 'json', false); - $element['thumb'] = end($element['link']); - unset($element['link']); + $element['thumb'] = end($element['link']); + unset($element['link']); - if ($type == 'xml') { - $thumb = $element['thumb']; - unset($element['thumb']); - $data['photo'][] = ['@attributes' => $element, '1' => $thumb]; - } else { - $data['photo'][] = $element; - } + if ($type == 'xml') { + $thumb = $element['thumb']; + unset($element['thumb']); + $data['photo'][] = ['@attributes' => $element, '1' => $thumb]; + } else { + $data['photo'][] = $element; } }