import { intoArray, toBoolean } from '@app/helpers'
-import { AttributesOnly } from '@shared/core-utils'
-import { BooleanBothQuery, NSFWPolicyType, VideoFilter, VideoSortField } from '@shared/models'
+import { AttributesOnly, getAllPrivacies } from '@shared/core-utils'
+import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoPrivacy, VideoSortField } from '@shared/models'
type VideoFiltersKeys = {
[ id in keyof AttributesOnly<VideoFilters> ]: any
}
setNSFWPolicy (nsfwPolicy: NSFWPolicyType) {
- console.log(nsfwPolicy)
-
this.updateDefaultNSFW(nsfwPolicy)
}
}
toVideosAPIObject () {
- let filter: VideoFilter
-
- if (this.scope === 'local' && this.allVideos) {
- filter = 'all-local'
- } else if (this.scope === 'federated' && this.allVideos) {
- filter = 'all'
- } else if (this.scope === 'local') {
- filter = 'local'
+ let isLocal: boolean
+ let include: VideoInclude
+ let privacyOneOf: VideoPrivacy[]
+
+ if (this.scope === 'local') {
+ isLocal = true
+ }
+
+ if (this.allVideos) {
+ include = VideoInclude.NOT_PUBLISHED_STATE
+ privacyOneOf = getAllPrivacies()
}
let isLive: boolean
languageOneOf: this.languageOneOf,
categoryOneOf: this.categoryOneOf,
search: this.search,
- filter,
+ isLocal,
+ include,
+ privacyOneOf,
isLive
}
}