From 37a44fc915eef2140e22ceb96aba6b6eb2509007 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jun 2021 16:02:38 +0200 Subject: Add ability to search playlists --- shared/models/plugins/client/client-hook.model.ts | 5 ++++- shared/models/plugins/server/server-hook.model.ts | 4 ++++ shared/models/search/index.ts | 3 ++- shared/models/search/video-channels-search-query.model.ts | 2 +- shared/models/search/video-playlists-search-query.model.ts | 9 +++++++++ shared/models/server/job.model.ts | 1 - shared/models/server/peertube-problem-document.model.ts | 2 +- shared/models/videos/playlist/video-playlist.model.ts | 4 ++++ 8 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 shared/models/search/video-playlists-search-query.model.ts (limited to 'shared/models') 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 = { // Filter params/result of the function that fetch videos according to the user search 'filter:api.search.videos.list.params': true, 'filter:api.search.videos.list.result': true, - // Filter params/result of the function that fetch video-channels according to the user search + // Filter params/result of the function that fetch video channels according to the user search 'filter:api.search.video-channels.list.params': true, 'filter:api.search.video-channels.list.result': true, + // Filter params/result of the function that fetch video playlists according to the user search + 'filter:api.search.video-playlists.list.params': true, + 'filter:api.search.video-playlists.list.result': true, // Filter form '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 = { 'filter:api.search.video-channels.local.list.result': true, 'filter:api.search.video-channels.index.list.params': true, 'filter:api.search.video-channels.index.list.result': true, + 'filter:api.search.video-playlists.local.list.params': true, + 'filter:api.search.video-playlists.local.list.result': true, + 'filter:api.search.video-playlists.index.list.params': true, + 'filter:api.search.video-playlists.index.list.result': true, // Filter the result of the get function // 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 @@ export * from './boolean-both-query.model' export * from './search-target-query.model' export * from './videos-common-query.model' -export * from './videos-search-query.model' export * from './video-channels-search-query.model' +export * from './video-playlists-search-query.model' +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 @@ -import { SearchTargetQuery } from "./search-target-query.model" +import { SearchTargetQuery } from './search-target-query.model' export interface VideoChannelsSearchQuery extends SearchTargetQuery { 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 @@ +import { SearchTargetQuery } from './search-target-query.model' + +export interface VideoPlaylistsSearchQuery extends SearchTargetQuery { + search: string + + start?: number + count?: number + sort?: string +} 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 = { uri: string type: FetchType videoId?: number - accountId?: number } 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 @@ -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '../../core-utils' import { OAuth2ErrorCode, ServerErrorCode } from './server-error-code.enum' 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 { uuid: string isLocal: boolean + url: string + displayName: string description: string privacy: VideoConstant thumbnailPath: string + thumbnailUrl?: string videosLength: number type: VideoConstant embedPath: string + embedUrl?: string createdAt: Date | string updatedAt: Date | string -- cgit v1.2.3