Update src/Module/Api/Friendica/Photoalbum/Show.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Hank G 2022-12-13 16:46:16 -05:00 committed by GitHub
parent ae8f1a1c5b
commit 6af4bfae21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}