From 29837f8885eb37fa300e4b80c90a6d03ab337084 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Jul 2021 09:07:38 +0200 Subject: Add ability to search by host in server --- server/models/user/user-notification.ts | 3 +++ .../models/video/sql/videos-id-list-query-builder.ts | 19 +++++++++++++++++++ server/models/video/video-playlist.ts | 2 +- server/models/video/video.ts | 6 ++++-- 4 files changed, 27 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.ts index a7f84e9ca..04c5513a9 100644 --- a/server/models/user/user-notification.ts +++ b/server/models/user/user-notification.ts @@ -1,5 +1,6 @@ import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize' import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' +import { uuidToShort } from '@server/helpers/uuid' import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user' import { AttributesOnly } from '@shared/core-utils' import { UserNotification, UserNotificationType } from '../../../shared' @@ -615,6 +616,7 @@ export class UserNotificationModel extends Model>> { static async searchAndPopulateAccountAndServer (options: { includeLocalVideos: boolean search?: string + host?: string start?: number count?: number sort?: string @@ -1151,6 +1152,7 @@ export class VideoModel extends Model>> { user: options.user, filter: options.filter, + host: options.host, start: options.start, count: options.count, @@ -1579,7 +1581,7 @@ export class VideoModel extends Model>> { } getWatchStaticPath () { - return buildVideoWatchPath({ shortUUID: shortToUUID(this.uuid) }) + return buildVideoWatchPath({ shortUUID: uuidToShort(this.uuid) }) } getEmbedStaticPath () { -- cgit v1.2.3