aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-27 09:07:38 +0200
committerChocobozzz <me@florianbigard.com>2021-07-27 17:10:52 +0200
commit29837f8885eb37fa300e4b80c90a6d03ab337084 (patch)
treea7a066c6604c9adec4cb21c1bd1965c5bf253b03 /server/models/video/video.ts
parent5d0095fde19d803bead7cbad0452bd09f3351adc (diff)
downloadPeerTube-29837f8885eb37fa300e4b80c90a6d03ab337084.tar.gz
PeerTube-29837f8885eb37fa300e4b80c90a6d03ab337084.tar.zst
PeerTube-29837f8885eb37fa300e4b80c90a6d03ab337084.zip
Add ability to search by host in server
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 543e604bb..c006a91af 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -26,7 +26,7 @@ import {
26} from 'sequelize-typescript' 26} from 'sequelize-typescript'
27import { setAsUpdated } from '@server/helpers/database-utils' 27import { setAsUpdated } from '@server/helpers/database-utils'
28import { buildNSFWFilter } from '@server/helpers/express-utils' 28import { buildNSFWFilter } from '@server/helpers/express-utils'
29import { shortToUUID } from '@server/helpers/uuid' 29import { uuidToShort } from '@server/helpers/uuid'
30import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' 30import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video'
31import { LiveManager } from '@server/lib/live/live-manager' 31import { LiveManager } from '@server/lib/live/live-manager'
32import { getHLSDirectory, getVideoFilePath } from '@server/lib/video-paths' 32import { getHLSDirectory, getVideoFilePath } from '@server/lib/video-paths'
@@ -1113,6 +1113,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1113 static async searchAndPopulateAccountAndServer (options: { 1113 static async searchAndPopulateAccountAndServer (options: {
1114 includeLocalVideos: boolean 1114 includeLocalVideos: boolean
1115 search?: string 1115 search?: string
1116 host?: string
1116 start?: number 1117 start?: number
1117 count?: number 1118 count?: number
1118 sort?: string 1119 sort?: string
@@ -1151,6 +1152,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1151 1152
1152 user: options.user, 1153 user: options.user,
1153 filter: options.filter, 1154 filter: options.filter,
1155 host: options.host,
1154 1156
1155 start: options.start, 1157 start: options.start,
1156 count: options.count, 1158 count: options.count,
@@ -1579,7 +1581,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1579 } 1581 }
1580 1582
1581 getWatchStaticPath () { 1583 getWatchStaticPath () {
1582 return buildVideoWatchPath({ shortUUID: shortToUUID(this.uuid) }) 1584 return buildVideoWatchPath({ shortUUID: uuidToShort(this.uuid) })
1583 } 1585 }
1584 1586
1585 getEmbedStaticPath () { 1587 getEmbedStaticPath () {