add channel avatar

This commit is contained in:
2025-04-09 08:40:03 +04:00
parent f06c9a4f76
commit 2b8d6d94f9
3 changed files with 66 additions and 3 deletions
+6
View File
@@ -274,6 +274,11 @@ function formatVideosData($videosData) {
$thumbnail = isset($video['previewPath'])
? PEERTUBE_URL . $video['previewPath']
: 'img/default-thumbnail.jpg';
// Récupérer l'avatar de la chaîne
$channelAvatar = isset($video['channel']['avatars'][0]['path']) && isset($video['channel']['avatars'][0]['path'])
? PEERTUBE_URL . $video['channel']['avatars'][0]['path']
: 'img/default-avatar.png';
// Formater les données
$videos[] = [
@@ -282,6 +287,7 @@ function formatVideosData($videosData) {
'thumbnail' => $thumbnail,
'duration' => $video['duration'],
'channel' => $video['channel']['displayName'],
'channelAvatar' => $channelAvatar,
'views' => $video['views'],
'date' => $video['publishedAt'],
'aspectRatio' => $video['aspectRatio'],