Support commentsPolicy
This commit is contained in:
parent
8eb43d3686
commit
4064d313fc
|
@ -169,6 +169,10 @@ export function formatVideoForDB (v: IndexableVideo | IndexableVideoDetails): DB
|
|||
support: v.support,
|
||||
|
||||
commentsEnabled: v.commentsEnabled,
|
||||
commentsPolicy: v.commentsPolicy
|
||||
? { id: v.commentsPolicy.id, label: v.commentsPolicy.label }
|
||||
: undefined,
|
||||
|
||||
downloadEnabled: v.downloadEnabled
|
||||
}
|
||||
}
|
||||
|
@ -242,5 +246,5 @@ export function formatVideoForAPI (v: DBVideoDetails, fromHost?: string): APIVid
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function isVideoDetails (video: IndexableVideo | IndexableVideoDetails): video is IndexableVideoDetails {
|
||||
return (video as IndexableVideoDetails).commentsEnabled !== undefined
|
||||
return (video as IndexableVideoDetails).support !== undefined
|
||||
}
|
||||
|
|
|
@ -7,6 +7,11 @@ export interface IndexableVideo extends Video, IndexableDoc {
|
|||
}
|
||||
|
||||
export interface IndexableVideoDetails extends VideoDetails, IndexableDoc {
|
||||
// TODO: remove when upgrading types to v6.2
|
||||
commentsPolicy: {
|
||||
id: number
|
||||
label: string
|
||||
}
|
||||
}
|
||||
|
||||
type IgnoredVideoFields = 'isLocal' | 'createdAt' | 'updatedAt' | 'publishedAt' | 'originallyPublishedAt' | 'channel' | 'account'
|
||||
|
@ -35,6 +40,12 @@ export interface DBVideoDetails extends Omit<VideoDetails, IgnoredVideoFields>,
|
|||
channel: DBChannel
|
||||
|
||||
_rankingScore?: number
|
||||
|
||||
// TODO: remove when upgrading types to v6.2
|
||||
commentsPolicy: {
|
||||
id: number
|
||||
label: string
|
||||
}
|
||||
}
|
||||
|
||||
// Results from the search API
|
||||
|
|
Loading…
Reference in New Issue