]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/query.ts
Improve wait transcoding help
[github/Chocobozzz/PeerTube.git] / server / helpers / query.ts
1 import { pick } from '@shared/core-utils'
2 import {
3 VideoChannelsSearchQueryAfterSanitize,
4 VideoPlaylistsSearchQueryAfterSanitize,
5 VideosCommonQueryAfterSanitize,
6 VideosSearchQueryAfterSanitize
7 } from '@shared/models'
8
9 function pickCommonVideoQuery (query: VideosCommonQueryAfterSanitize) {
10 return pick(query, [
11 'start',
12 'count',
13 'sort',
14 'nsfw',
15 'isLive',
16 'categoryOneOf',
17 'licenceOneOf',
18 'languageOneOf',
19 'privacyOneOf',
20 'tagsOneOf',
21 'tagsAllOf',
22 'isLocal',
23 'include',
24 'skipCount',
25 'hasHLSFiles',
26 'hasWebtorrentFiles',
27 'search'
28 ])
29 }
30
31 function pickSearchVideoQuery (query: VideosSearchQueryAfterSanitize) {
32 return {
33 ...pickCommonVideoQuery(query),
34
35 ...pick(query, [
36 'searchTarget',
37 'host',
38 'startDate',
39 'endDate',
40 'originallyPublishedStartDate',
41 'originallyPublishedEndDate',
42 'durationMin',
43 'durationMax',
44 'uuids'
45 ])
46 }
47 }
48
49 function pickSearchChannelQuery (query: VideoChannelsSearchQueryAfterSanitize) {
50 return pick(query, [
51 'searchTarget',
52 'search',
53 'start',
54 'count',
55 'sort',
56 'host',
57 'handles'
58 ])
59 }
60
61 function pickSearchPlaylistQuery (query: VideoPlaylistsSearchQueryAfterSanitize) {
62 return pick(query, [
63 'searchTarget',
64 'search',
65 'start',
66 'count',
67 'sort',
68 'host',
69 'uuids'
70 ])
71 }
72
73 export {
74 pickCommonVideoQuery,
75 pickSearchVideoQuery,
76 pickSearchPlaylistQuery,
77 pickSearchChannelQuery
78 }