Room list: handle channel rooms.

This commit is contained in:
John Livingston
2021-08-05 18:25:27 +02:00
parent 855ed51251
commit e9d1e55084
4 changed files with 95 additions and 26 deletions

View File

@ -60,7 +60,8 @@ async function getChannelInfosById (options: RegisterServerOptions, channelId: n
}
const [results] = await options.peertubeHelpers.database.query(
'SELECT' +
' "actor"."preferredUsername" as "channelName", ' +
' "actor"."preferredUsername" as "channelName",' +
' "videoChannel"."id" as "channelId",' +
' "videoChannel"."name" as "channelDisplayName"' +
' FROM "videoChannel"' +
' RIGHT JOIN "actor" ON "actor"."id" = "videoChannel"."actorId"' +
@ -74,7 +75,7 @@ async function getChannelInfosById (options: RegisterServerOptions, channelId: n
return null
}
return {
id: channelId,
id: results[0].channelId,
name: results[0].channelName ?? '',
displayName: results[0].channelDisplayName ?? ''
}