Skip to content

Commit

Permalink
Ampache: Set the has_art property properly in the user action
Browse files Browse the repository at this point in the history
On recent versions of Nextcloud, the avatar is always available; either
as user-provided or as a placeholder graphic. On ownCloud, on the other
hand, the avatar is available via the normal URL only if it has been
provided by the user. Otherwise, the URL returns a simple JSON content.
In those cases, the `has_art` is now returned as false.
  • Loading branch information
paulijar committed Apr 21, 2024
1 parent 3698e2a commit 9149e19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Controller/AmpacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ protected function user(?string $username) : array {
'state' => null,
'city' => null,
'art' => $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $user->getUID(), 'size' => 64]),
'has_art' => true
'has_art' => ($user->getAvatarImage(64) != null)
];
}

Expand Down

0 comments on commit 9149e19

Please sign in to comment.