2023-11-09 14:34:36 +01:00
|
|
|
import { VideoChannel, VideoChannelSummary } from '@peertube/peertube-types'
|
|
|
|
import { DBActorImage } from './actor.model'
|
2021-06-24 15:18:54 +02:00
|
|
|
import { IndexableDoc } from './indexable-doc.model'
|
2023-11-09 14:34:36 +01:00
|
|
|
import { DBAccount } from './account.model'
|
2020-02-19 15:39:35 +01:00
|
|
|
|
|
|
|
export interface IndexableChannel extends VideoChannel, IndexableDoc {
|
|
|
|
}
|
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
interface DBChannelShared {
|
2020-05-28 16:32:49 +02:00
|
|
|
handle: string
|
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
avatar: DBActorImage
|
|
|
|
avatars: DBActorImage[]
|
|
|
|
}
|
|
|
|
|
|
|
|
type IgnoredChannelFields = 'ownerAccount' | 'isLocal' | 'createdAt' | 'updatedAt' | 'avatar' | 'avatars' | 'banner' | 'banners'
|
|
|
|
|
|
|
|
export interface DBChannel extends DBChannelShared, Omit<VideoChannel, IgnoredChannelFields> {
|
|
|
|
indexedAt: number
|
2020-06-09 14:29:20 +02:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
primaryKey: string
|
2022-02-26 12:52:51 +01:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
ownerAccount?: DBAccount
|
2020-08-27 14:44:21 +02:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
banner: DBActorImage
|
|
|
|
banners: DBActorImage[]
|
|
|
|
|
|
|
|
createdAt: number
|
|
|
|
updatedAt: number
|
|
|
|
|
|
|
|
_rankingScore?: number
|
2020-02-19 15:39:35 +01:00
|
|
|
}
|
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
export interface DBChannelSummary extends DBChannelShared, Omit<VideoChannelSummary, 'avatar' | 'avatars'> {
|
|
|
|
|
2020-02-19 15:39:35 +01:00
|
|
|
}
|
2020-08-27 14:44:21 +02:00
|
|
|
|
|
|
|
// Results from the search API
|
2023-11-09 14:34:36 +01:00
|
|
|
export interface APIVideoChannel extends VideoChannel {
|
2022-12-20 15:35:09 +01:00
|
|
|
videosCount: number
|
|
|
|
|
2020-08-27 14:44:21 +02:00
|
|
|
score: number
|
|
|
|
}
|