1
0
Fork 0
peertube/shared/models/videos/channel/video-channel.model.ts
Florian CUNY c6f8ca4d65
Added "total views" in the my channels list (#5007)
* Added "total views" in the my channels list

Implements https://github.com/Chocobozzz/PeerTube/issues/4331

* Fix lint

* applied suggested change

* updated openAPI spec for the use "withStats" when getting video channels

* applied code change

* removed GROUP BY in query

* Fixed test
2022-05-31 16:01:11 +02:00

40 lines
738 B
TypeScript

import { Account, ActorImage } from '../../actors'
import { Actor } from '../../actors/actor.model'
export type ViewsPerDate = {
date: Date
views: number
}
export interface VideoChannel extends Actor {
displayName: string
description: string
support: string
isLocal: boolean
updatedAt: Date | string
ownerAccount?: Account
videosCount?: number
viewsPerDay?: ViewsPerDate[] // chronologically ordered
totalViews?: number
banners: ActorImage[]
// TODO: remove, deprecated in 4.2
banner: ActorImage
}
export interface VideoChannelSummary {
id: number
name: string
displayName: string
url: string
host: string
avatars: ActorImage[]
// TODO: remove, deprecated in 4.2
avatar: ActorImage
}