2023-11-09 14:34:36 +01:00
|
|
|
import { Video, VideoDetails } from '@peertube/peertube-types'
|
2021-06-24 15:18:54 +02:00
|
|
|
import { IndexableDoc } from './indexable-doc.model'
|
2023-11-09 14:34:36 +01:00
|
|
|
import { DBChannel, DBChannelSummary } from './channel.model'
|
|
|
|
import { DBAccount, DBAccountSummary } from './account.model'
|
2020-02-14 16:14:45 +01:00
|
|
|
|
|
|
|
export interface IndexableVideo extends Video, IndexableDoc {
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IndexableVideoDetails extends VideoDetails, IndexableDoc {
|
|
|
|
}
|
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
type IgnoredVideoFields = 'isLocal' | 'createdAt' | 'updatedAt' | 'publishedAt' | 'originallyPublishedAt' | 'channel' | 'account'
|
2020-05-28 16:32:49 +02:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
interface DBVideoShared {
|
|
|
|
indexedAt: number
|
2020-08-27 14:44:21 +02:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
createdAt: number
|
|
|
|
updatedAt: number
|
|
|
|
publishedAt: number
|
|
|
|
originallyPublishedAt: number
|
2020-02-14 16:14:45 +01:00
|
|
|
|
|
|
|
host: string
|
2020-06-05 14:37:39 +02:00
|
|
|
url: string
|
2023-11-09 14:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DBVideo extends Omit<Video, IgnoredVideoFields>, DBVideoShared {
|
|
|
|
account: DBAccountSummary
|
|
|
|
channel: DBChannelSummary
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DBVideoDetails extends Omit<VideoDetails, IgnoredVideoFields>, DBVideoShared {
|
|
|
|
account: DBAccount
|
|
|
|
channel: DBChannel
|
2020-05-28 16:32:49 +02:00
|
|
|
|
2023-11-09 14:34:36 +01:00
|
|
|
_rankingScore?: number
|
2020-02-14 16:14:45 +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 APIVideo extends Video {
|
2020-08-27 14:44:21 +02:00
|
|
|
tags: VideoDetails['tags']
|
|
|
|
|
|
|
|
score: number
|
|
|
|
}
|