aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-29 16:16:24 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-10 14:02:41 +0200
commit5fb2e2888ce032c638e4b75d07458642f0833e52 (patch)
tree8830d873569316889b8134027e9a43b198cca38f /shared/models
parent62e7be634bc189f942ae51cb4b080079ab503ff0 (diff)
downloadPeerTube-5fb2e2888ce032c638e4b75d07458642f0833e52.tar.gz
PeerTube-5fb2e2888ce032c638e4b75d07458642f0833e52.tar.zst
PeerTube-5fb2e2888ce032c638e4b75d07458642f0833e52.zip
First implem global search
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/avatars/avatar.model.ts3
-rw-r--r--shared/models/search/search-target-query.model.ts5
-rw-r--r--shared/models/search/video-channels-search-query.model.ts4
-rw-r--r--shared/models/search/videos-search-query.model.ts5
-rw-r--r--shared/models/server/custom-config.model.ts14
-rw-r--r--shared/models/server/server-config.model.ts7
-rw-r--r--shared/models/videos/video.model.ts10
7 files changed, 46 insertions, 2 deletions
diff --git a/shared/models/avatars/avatar.model.ts b/shared/models/avatars/avatar.model.ts
index 301d00929..f7fa16f49 100644
--- a/shared/models/avatars/avatar.model.ts
+++ b/shared/models/avatars/avatar.model.ts
@@ -1,5 +1,8 @@
1export interface Avatar { 1export interface Avatar {
2 path: string 2 path: string
3
4 url?: string
5
3 createdAt: Date | string 6 createdAt: Date | string
4 updatedAt: Date | string 7 updatedAt: Date | string
5} 8}
diff --git a/shared/models/search/search-target-query.model.ts b/shared/models/search/search-target-query.model.ts
new file mode 100644
index 000000000..3bb2e0d31
--- /dev/null
+++ b/shared/models/search/search-target-query.model.ts
@@ -0,0 +1,5 @@
1export type SearchTargetType = 'local' | 'search-index'
2
3export interface SearchTargetQuery {
4 searchTarget?: SearchTargetType
5}
diff --git a/shared/models/search/video-channels-search-query.model.ts b/shared/models/search/video-channels-search-query.model.ts
index de2741e14..c96aa8c1d 100644
--- a/shared/models/search/video-channels-search-query.model.ts
+++ b/shared/models/search/video-channels-search-query.model.ts
@@ -1,4 +1,6 @@
1export interface VideoChannelsSearchQuery { 1import { SearchTargetQuery } from "./search-target-query.model"
2
3export interface VideoChannelsSearchQuery extends SearchTargetQuery {
2 search: string 4 search: string
3 5
4 start?: number 6 start?: number
diff --git a/shared/models/search/videos-search-query.model.ts b/shared/models/search/videos-search-query.model.ts
index 838063095..bd6bb5bc1 100644
--- a/shared/models/search/videos-search-query.model.ts
+++ b/shared/models/search/videos-search-query.model.ts
@@ -1,7 +1,10 @@
1import { NSFWQuery } from './nsfw-query.model' 1import { NSFWQuery } from './nsfw-query.model'
2import { VideoFilter } from '../videos' 2import { VideoFilter } from '../videos'
3import { SearchTargetQuery } from './search-target-query.model'
4
5export interface VideosSearchQuery extends SearchTargetQuery {
6 forceLocalSearch?: boolean
3 7
4export interface VideosSearchQuery {
5 search?: string 8 search?: string
6 9
7 start?: number 10 start?: number
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 851bf1854..338a59341 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -139,4 +139,18 @@ export interface CustomConfig {
139 level: BroadcastMessageLevel 139 level: BroadcastMessageLevel
140 dismissable: boolean 140 dismissable: boolean
141 } 141 }
142
143 search: {
144 remoteUri: {
145 users: boolean
146 anonymous: boolean
147 }
148
149 searchIndex: {
150 enabled: boolean
151 url: string
152 disableLocalSearch: boolean
153 isDefaultSearch: boolean
154 }
155 }
142} 156}
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index 9c903b7ee..a8e5dfbff 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -50,6 +50,13 @@ export interface ServerConfig {
50 users: boolean 50 users: boolean
51 anonymous: boolean 51 anonymous: boolean
52 } 52 }
53
54 searchIndex: {
55 enabled: boolean
56 url: string
57 disableLocalSearch: boolean
58 isDefaultSearch: boolean
59 }
53 } 60 }
54 61
55 plugin: { 62 plugin: {
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index a69152759..0f8822125 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -22,9 +22,19 @@ export interface Video {
22 duration: number 22 duration: number
23 isLocal: boolean 23 isLocal: boolean
24 name: string 24 name: string
25
25 thumbnailPath: string 26 thumbnailPath: string
27 thumbnailUrl?: string
28
26 previewPath: string 29 previewPath: string
30 previewUrl?: string
31
27 embedPath: string 32 embedPath: string
33 embedUrl?: string
34
35 // When using the search index
36 url?: string
37
28 views: number 38 views: number
29 likes: number 39 likes: number
30 dislikes: number 40 dislikes: number