diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-17 16:02:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-25 14:44:01 +0200 |
commit | 37a44fc915eef2140e22ceb96aba6b6eb2509007 (patch) | |
tree | dd4a370ecc96cf38c99b940261aadc27065da7ae /shared/models | |
parent | 33eb19e5199cc9fa4d73c6675c97508e3e072ef9 (diff) | |
download | PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.gz PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.zst PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.zip |
Add ability to search playlists
Diffstat (limited to 'shared/models')
8 files changed, 25 insertions, 5 deletions
diff --git a/shared/models/plugins/client/client-hook.model.ts b/shared/models/plugins/client/client-hook.model.ts index 546866845..cedd1be61 100644 --- a/shared/models/plugins/client/client-hook.model.ts +++ b/shared/models/plugins/client/client-hook.model.ts | |||
@@ -37,9 +37,12 @@ export const clientFilterHookObject = { | |||
37 | // Filter params/result of the function that fetch videos according to the user search | 37 | // Filter params/result of the function that fetch videos according to the user search |
38 | 'filter:api.search.videos.list.params': true, | 38 | 'filter:api.search.videos.list.params': true, |
39 | 'filter:api.search.videos.list.result': true, | 39 | 'filter:api.search.videos.list.result': true, |
40 | // Filter params/result of the function that fetch video-channels according to the user search | 40 | // Filter params/result of the function that fetch video channels according to the user search |
41 | 'filter:api.search.video-channels.list.params': true, | 41 | 'filter:api.search.video-channels.list.params': true, |
42 | 'filter:api.search.video-channels.list.result': true, | 42 | 'filter:api.search.video-channels.list.result': true, |
43 | // Filter params/result of the function that fetch video playlists according to the user search | ||
44 | 'filter:api.search.video-playlists.list.params': true, | ||
45 | 'filter:api.search.video-playlists.list.result': true, | ||
43 | 46 | ||
44 | // Filter form | 47 | // Filter form |
45 | 'filter:api.signup.registration.create.params': true, | 48 | 'filter:api.signup.registration.create.params': true, |
diff --git a/shared/models/plugins/server/server-hook.model.ts b/shared/models/plugins/server/server-hook.model.ts index 88277af5a..dae243dbf 100644 --- a/shared/models/plugins/server/server-hook.model.ts +++ b/shared/models/plugins/server/server-hook.model.ts | |||
@@ -27,6 +27,10 @@ export const serverFilterHookObject = { | |||
27 | 'filter:api.search.video-channels.local.list.result': true, | 27 | 'filter:api.search.video-channels.local.list.result': true, |
28 | 'filter:api.search.video-channels.index.list.params': true, | 28 | 'filter:api.search.video-channels.index.list.params': true, |
29 | 'filter:api.search.video-channels.index.list.result': true, | 29 | 'filter:api.search.video-channels.index.list.result': true, |
30 | 'filter:api.search.video-playlists.local.list.params': true, | ||
31 | 'filter:api.search.video-playlists.local.list.result': true, | ||
32 | 'filter:api.search.video-playlists.index.list.params': true, | ||
33 | 'filter:api.search.video-playlists.index.list.result': true, | ||
30 | 34 | ||
31 | // Filter the result of the get function | 35 | // Filter the result of the get function |
32 | // Used to get detailed video information (video watch page for example) | 36 | // Used to get detailed video information (video watch page for example) |
diff --git a/shared/models/search/index.ts b/shared/models/search/index.ts index 697ceccb1..50aeeddc8 100644 --- a/shared/models/search/index.ts +++ b/shared/models/search/index.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | export * from './boolean-both-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-common-query.model' |
4 | export * from './videos-search-query.model' | ||
5 | export * from './video-channels-search-query.model' | 4 | export * from './video-channels-search-query.model' |
5 | export * from './video-playlists-search-query.model' | ||
6 | export * from './videos-search-query.model' | ||
diff --git a/shared/models/search/video-channels-search-query.model.ts b/shared/models/search/video-channels-search-query.model.ts index c96aa8c1d..8f93c4bd5 100644 --- a/shared/models/search/video-channels-search-query.model.ts +++ b/shared/models/search/video-channels-search-query.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { SearchTargetQuery } from "./search-target-query.model" | 1 | import { SearchTargetQuery } from './search-target-query.model' |
2 | 2 | ||
3 | export interface VideoChannelsSearchQuery extends SearchTargetQuery { | 3 | export interface VideoChannelsSearchQuery extends SearchTargetQuery { |
4 | search: string | 4 | search: string |
diff --git a/shared/models/search/video-playlists-search-query.model.ts b/shared/models/search/video-playlists-search-query.model.ts new file mode 100644 index 000000000..31f05218e --- /dev/null +++ b/shared/models/search/video-playlists-search-query.model.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | import { SearchTargetQuery } from './search-target-query.model' | ||
2 | |||
3 | export interface VideoPlaylistsSearchQuery extends SearchTargetQuery { | ||
4 | search: string | ||
5 | |||
6 | start?: number | ||
7 | count?: number | ||
8 | sort?: string | ||
9 | } | ||
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index e4acfee8d..4ab249e0b 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts | |||
@@ -53,7 +53,6 @@ export type ActivitypubHttpFetcherPayload = { | |||
53 | uri: string | 53 | uri: string |
54 | type: FetchType | 54 | type: FetchType |
55 | videoId?: number | 55 | videoId?: number |
56 | accountId?: number | ||
57 | } | 56 | } |
58 | 57 | ||
59 | export type ActivitypubHttpUnicastPayload = { | 58 | export type ActivitypubHttpUnicastPayload = { |
diff --git a/shared/models/server/peertube-problem-document.model.ts b/shared/models/server/peertube-problem-document.model.ts index 5e1c320f3..e391d5aad 100644 --- a/shared/models/server/peertube-problem-document.model.ts +++ b/shared/models/server/peertube-problem-document.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { HttpStatusCode } from '@shared/core-utils' | 1 | import { HttpStatusCode } from '../../core-utils' |
2 | import { OAuth2ErrorCode, ServerErrorCode } from './server-error-code.enum' | 2 | import { OAuth2ErrorCode, ServerErrorCode } from './server-error-code.enum' |
3 | 3 | ||
4 | export interface PeerTubeProblemDocumentData { | 4 | export interface PeerTubeProblemDocumentData { |
diff --git a/shared/models/videos/playlist/video-playlist.model.ts b/shared/models/videos/playlist/video-playlist.model.ts index f45d0ff88..ab4171ad1 100644 --- a/shared/models/videos/playlist/video-playlist.model.ts +++ b/shared/models/videos/playlist/video-playlist.model.ts | |||
@@ -8,17 +8,21 @@ export interface VideoPlaylist { | |||
8 | uuid: string | 8 | uuid: string |
9 | isLocal: boolean | 9 | isLocal: boolean |
10 | 10 | ||
11 | url: string | ||
12 | |||
11 | displayName: string | 13 | displayName: string |
12 | description: string | 14 | description: string |
13 | privacy: VideoConstant<VideoPlaylistPrivacy> | 15 | privacy: VideoConstant<VideoPlaylistPrivacy> |
14 | 16 | ||
15 | thumbnailPath: string | 17 | thumbnailPath: string |
18 | thumbnailUrl?: string | ||
16 | 19 | ||
17 | videosLength: number | 20 | videosLength: number |
18 | 21 | ||
19 | type: VideoConstant<VideoPlaylistType> | 22 | type: VideoConstant<VideoPlaylistType> |
20 | 23 | ||
21 | embedPath: string | 24 | embedPath: string |
25 | embedUrl?: string | ||
22 | 26 | ||
23 | createdAt: Date | string | 27 | createdAt: Date | string |
24 | updatedAt: Date | string | 28 | updatedAt: Date | string |