Display total videos of channels
This commit is contained in:
parent
f7eb829b5c
commit
b4a218b331
|
@ -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>
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -28,5 +28,7 @@ export interface DBChannelSummary extends VideoChannelSummary {
|
|||
|
||||
// Results from the search API
|
||||
export interface EnhancedVideoChannel extends VideoChannel {
|
||||
videosCount: number
|
||||
|
||||
score: number
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue