From 868fce62f86812759ccedccf7634236ac3701d9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Jun 2021 18:10:56 +0200 Subject: fetch -> load avoid confusion with AP fetch functions --- server/middlewares/validators/oembed.ts | 4 ++-- server/middlewares/validators/shared/videos.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/oembed.ts b/server/middlewares/validators/oembed.ts index ab117635e..e1015d7fd 100644 --- a/server/middlewares/validators/oembed.ts +++ b/server/middlewares/validators/oembed.ts @@ -1,7 +1,7 @@ import * as express from 'express' import { query } from 'express-validator' import { join } from 'path' -import { fetchVideo } from '@server/lib/model-loaders' +import { loadVideo } from '@server/lib/model-loaders' import { VideoPlaylistModel } from '@server/models/video/video-playlist' import { VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' @@ -85,7 +85,7 @@ const oembedValidator = [ } if (isVideo) { - const video = await fetchVideo(elementId, 'all') + const video = await loadVideo(elementId, 'all') if (!video) { return res.fail({ diff --git a/server/middlewares/validators/shared/videos.ts b/server/middlewares/validators/shared/videos.ts index a6dad4374..3134f623d 100644 --- a/server/middlewares/validators/shared/videos.ts +++ b/server/middlewares/validators/shared/videos.ts @@ -1,5 +1,5 @@ import { Response } from 'express' -import { fetchVideo, VideoFetchType } from '@server/lib/model-loaders' +import { loadVideo, VideoLoadType } from '@server/lib/model-loaders' import { VideoChannelModel } from '@server/models/video/video-channel' import { VideoFileModel } from '@server/models/video/video-file' import { @@ -15,10 +15,10 @@ import { import { HttpStatusCode } from '@shared/core-utils' import { UserRight } from '@shared/models' -async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') { +async function doesVideoExist (id: number | string, res: Response, fetchType: VideoLoadType = 'all') { const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined - const video = await fetchVideo(id, fetchType, userId) + const video = await loadVideo(id, fetchType, userId) if (video === null) { res.fail({ -- cgit v1.2.3