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 --> <!-- eslint-enable -->
<div class="metadata"> <div class="metadata">
<div>
<label>{{ $ngettext('%{videosCount} video', '%{videosCount} videos', channel.videosCount, { videosCount: channel.videosCount }) }}</label>
</div>
<div> <div>
<label>{{ $gettext('Channel created on platform') }}</label> <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) { if (search.host) {
filter.push({ filter.push({
term: { term: {
@ -104,6 +110,8 @@ function formatChannelForAPI (c: DBChannel, fromHost?: string): EnhancedVideoCha
support: c.support, support: c.support,
isLocal: fromHost === c.host, isLocal: fromHost === c.host,
videosCount: c.videosCount || 0,
ownerAccount: { ownerAccount: {
id: c.ownerAccount.id, id: c.ownerAccount.id,
url: c.ownerAccount.url, url: c.ownerAccount.url,

View File

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