Display total videos of channels

This commit is contained in:
Chocobozzz 2022-12-20 15:35:09 +01:00
parent f7eb829b5c
commit b4a218b331
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,10 @@
<!-- eslint-enable -->
<div class="metadata">
<div>
<label>{{ $ngettext('%{videosCount} video', '%{videosCount} videos', channel.videosCount, { videosCount: channel.videosCount }) }}</label>
</div>
<div>
<label>{{ $gettext('Channel created on platform') }}</label>

View File

@ -38,6 +38,12 @@ async function queryChannels (search: ChannelsSearchQuery) {
})
}
mustNot.push({
term: {
videosCount: 0
}
})
if (search.host) {
filter.push({
term: {
@ -104,6 +110,8 @@ function formatChannelForAPI (c: DBChannel, fromHost?: string): EnhancedVideoCha
support: c.support,
isLocal: fromHost === c.host,
videosCount: c.videosCount || 0,
ownerAccount: {
id: c.ownerAccount.id,
url: c.ownerAccount.url,

View File

@ -28,5 +28,7 @@ export interface DBChannelSummary extends VideoChannelSummary {
// Results from the search API
export interface EnhancedVideoChannel extends VideoChannel {
videosCount: number
score: number
}