diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-03 11:06:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-03 16:42:15 +0200 |
commit | 1fd61899eaea245a5844e33e21f04b2562f16e5e (patch) | |
tree | 2a1d51b37b12219cade35e189d62686cd0fec105 /shared/models | |
parent | dfcb6f50a607b6b402b4f8fa3d43792d61c912a5 (diff) | |
download | PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.gz PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.zst PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.zip |
Add ability to filter my videos by live
Diffstat (limited to 'shared/models')
-rw-r--r-- | shared/models/search/boolean-both-query.model.ts | 1 | ||||
-rw-r--r-- | shared/models/search/index.ts | 3 | ||||
-rw-r--r-- | shared/models/search/nsfw-query.model.ts | 1 | ||||
-rw-r--r-- | shared/models/search/videos-common-query.model.ts | 28 | ||||
-rw-r--r-- | shared/models/search/videos-search-query.model.ts | 22 |
5 files changed, 33 insertions, 22 deletions
diff --git a/shared/models/search/boolean-both-query.model.ts b/shared/models/search/boolean-both-query.model.ts new file mode 100644 index 000000000..57b0e8d44 --- /dev/null +++ b/shared/models/search/boolean-both-query.model.ts | |||
@@ -0,0 +1 @@ | |||
export type BooleanBothQuery = 'true' | 'false' | 'both' | |||
diff --git a/shared/models/search/index.ts b/shared/models/search/index.ts index e2d0ab620..697ceccb1 100644 --- a/shared/models/search/index.ts +++ b/shared/models/search/index.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | export * from './nsfw-query.model' | 1 | export * from './boolean-both-query.model' |
2 | export * from './search-target-query.model' | 2 | export * from './search-target-query.model' |
3 | export * from './videos-common-query.model' | ||
3 | export * from './videos-search-query.model' | 4 | export * from './videos-search-query.model' |
4 | export * from './video-channels-search-query.model' | 5 | export * from './video-channels-search-query.model' |
diff --git a/shared/models/search/nsfw-query.model.ts b/shared/models/search/nsfw-query.model.ts deleted file mode 100644 index 6b6ad1991..000000000 --- a/shared/models/search/nsfw-query.model.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export type NSFWQuery = 'true' | 'false' | 'both' | ||
diff --git a/shared/models/search/videos-common-query.model.ts b/shared/models/search/videos-common-query.model.ts new file mode 100644 index 000000000..bd02489ea --- /dev/null +++ b/shared/models/search/videos-common-query.model.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | import { VideoFilter } from '../videos' | ||
2 | import { BooleanBothQuery } from './boolean-both-query.model' | ||
3 | |||
4 | // These query parameters can be used with any endpoint that list videos | ||
5 | export interface VideosCommonQuery { | ||
6 | start?: number | ||
7 | count?: number | ||
8 | sort?: string | ||
9 | |||
10 | nsfw?: BooleanBothQuery | ||
11 | |||
12 | isLive?: boolean | ||
13 | |||
14 | categoryOneOf?: number[] | ||
15 | |||
16 | licenceOneOf?: number[] | ||
17 | |||
18 | languageOneOf?: string[] | ||
19 | |||
20 | tagsOneOf?: string[] | ||
21 | tagsAllOf?: string[] | ||
22 | |||
23 | filter?: VideoFilter | ||
24 | } | ||
25 | |||
26 | export interface VideosWithSearchCommonQuery extends VideosCommonQuery { | ||
27 | search?: string | ||
28 | } | ||
diff --git a/shared/models/search/videos-search-query.model.ts b/shared/models/search/videos-search-query.model.ts index 3ce4ff73e..406f6cab2 100644 --- a/shared/models/search/videos-search-query.model.ts +++ b/shared/models/search/videos-search-query.model.ts | |||
@@ -1,33 +1,15 @@ | |||
1 | import { VideoFilter } from '../videos' | ||
2 | import { NSFWQuery } from './nsfw-query.model' | ||
3 | import { SearchTargetQuery } from './search-target-query.model' | 1 | import { SearchTargetQuery } from './search-target-query.model' |
2 | import { VideosCommonQuery } from './videos-common-query.model' | ||
4 | 3 | ||
5 | export interface VideosSearchQuery extends SearchTargetQuery { | 4 | export interface VideosSearchQuery extends SearchTargetQuery, VideosCommonQuery { |
6 | search?: string | 5 | search?: string |
7 | 6 | ||
8 | start?: number | ||
9 | count?: number | ||
10 | sort?: string | ||
11 | |||
12 | startDate?: string // ISO 8601 | 7 | startDate?: string // ISO 8601 |
13 | endDate?: string // ISO 8601 | 8 | endDate?: string // ISO 8601 |
14 | 9 | ||
15 | originallyPublishedStartDate?: string // ISO 8601 | 10 | originallyPublishedStartDate?: string // ISO 8601 |
16 | originallyPublishedEndDate?: string // ISO 8601 | 11 | originallyPublishedEndDate?: string // ISO 8601 |
17 | 12 | ||
18 | nsfw?: NSFWQuery | ||
19 | |||
20 | categoryOneOf?: number[] | ||
21 | |||
22 | licenceOneOf?: number[] | ||
23 | |||
24 | languageOneOf?: string[] | ||
25 | |||
26 | tagsOneOf?: string[] | ||
27 | tagsAllOf?: string[] | ||
28 | |||
29 | durationMin?: number // seconds | 13 | durationMin?: number // seconds |
30 | durationMax?: number // seconds | 14 | durationMax?: number // seconds |
31 | |||
32 | filter?: VideoFilter | ||
33 | } | 15 | } |