Split types and typings
This commit is contained in:
parent
d6d951ddc0
commit
26d6bf6533
|
@ -35,7 +35,7 @@ import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
|
||||||
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
|
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
|
||||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||||
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||||
import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/typings/models'
|
import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { getRateUrl } from '@server/lib/activitypub/video-rates'
|
import { getRateUrl } from '@server/lib/activitypub/video-rates'
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { processActivities } from '../../lib/activitypub/process/process'
|
||||||
import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares'
|
import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares'
|
||||||
import { activityPubValidator } from '../../middlewares/validators/activitypub/activity'
|
import { activityPubValidator } from '../../middlewares/validators/activitypub/activity'
|
||||||
import { queue } from 'async'
|
import { queue } from 'async'
|
||||||
import { MActorDefault, MActorSignature } from '../../typings/models'
|
import { MActorDefault, MActorSignature } from '../../types/models'
|
||||||
|
|
||||||
const inboxRouter = express.Router()
|
const inboxRouter = express.Router()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { buildAudience } from '../../lib/activitypub/audience'
|
||||||
import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } from '../../middlewares'
|
import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } from '../../middlewares'
|
||||||
import { VideoModel } from '../../models/video/video'
|
import { VideoModel } from '../../models/video/video'
|
||||||
import { activityPubResponse } from './utils'
|
import { activityPubResponse } from './utils'
|
||||||
import { MActorLight } from '@server/typings/models'
|
import { MActorLight } from '@server/types/models'
|
||||||
import { apPaginationValidator } from '../../middlewares/validators/activitypub'
|
import { apPaginationValidator } from '../../middlewares/validators/activitypub'
|
||||||
|
|
||||||
const outboxRouter = express.Router()
|
const outboxRouter = express.Router()
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
} from '../../middlewares'
|
} from '../../middlewares'
|
||||||
import { VideoModel } from '../../models/video/video'
|
import { VideoModel } from '../../models/video/video'
|
||||||
import { VideoChannelModel } from '../../models/video/video-channel'
|
import { VideoChannelModel } from '../../models/video/video-channel'
|
||||||
import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../typings/models'
|
import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../types/models'
|
||||||
|
|
||||||
const searchRouter = express.Router()
|
const searchRouter = express.Router()
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ import { CONFIG } from '../../../initializers/config'
|
||||||
import { sequelizeTypescript } from '../../../initializers/database'
|
import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
|
||||||
import { UserRegister } from '../../../../shared/models/users/user-register.model'
|
import { UserRegister } from '../../../../shared/models/users/user-register.model'
|
||||||
import { MUser, MUserAccountDefault } from '@server/typings/models'
|
import { MUser, MUserAccountDefault } from '@server/types/models'
|
||||||
import { Hooks } from '@server/lib/plugins/hooks'
|
import { Hooks } from '@server/lib/plugins/hooks'
|
||||||
import { tokensRouter } from '@server/controllers/api/users/token'
|
import { tokensRouter } from '@server/controllers/api/users/token'
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||||
import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
|
import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
|
||||||
import { CONFIG } from '../../initializers/config'
|
import { CONFIG } from '../../initializers/config'
|
||||||
import { sequelizeTypescript } from '../../initializers/database'
|
import { sequelizeTypescript } from '../../initializers/database'
|
||||||
import { MChannelAccountDefault } from '@server/typings/models'
|
import { MChannelAccountDefault } from '@server/types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
const auditLogger = auditLoggerFactory('channels')
|
const auditLogger = auditLoggerFactory('channels')
|
||||||
|
|
|
@ -40,7 +40,7 @@ import { JobQueue } from '../../lib/job-queue'
|
||||||
import { CONFIG } from '../../initializers/config'
|
import { CONFIG } from '../../initializers/config'
|
||||||
import { sequelizeTypescript } from '../../initializers/database'
|
import { sequelizeTypescript } from '../../initializers/database'
|
||||||
import { createPlaylistMiniatureFromExisting } from '../../lib/thumbnail'
|
import { createPlaylistMiniatureFromExisting } from '../../lib/thumbnail'
|
||||||
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/typings/models'
|
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })
|
const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })
|
||||||
|
|
|
@ -22,9 +22,9 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse'
|
||||||
import { auditLoggerFactory, VideoAbuseAuditView } from '../../../helpers/audit-logger'
|
import { auditLoggerFactory, VideoAbuseAuditView } from '../../../helpers/audit-logger'
|
||||||
import { Notifier } from '../../../lib/notifier'
|
import { Notifier } from '../../../lib/notifier'
|
||||||
import { sendVideoAbuse } from '../../../lib/activitypub/send/send-flag'
|
import { sendVideoAbuse } from '../../../lib/activitypub/send/send-flag'
|
||||||
import { MVideoAbuseAccountVideo } from '../../../typings/models/video'
|
import { MVideoAbuseAccountVideo } from '../../../types/models/video'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { MAccountDefault } from '@server/typings/models'
|
import { MAccountDefault } from '@server/types/models'
|
||||||
|
|
||||||
const auditLogger = auditLoggerFactory('abuse')
|
const auditLogger = auditLoggerFactory('abuse')
|
||||||
const abuseVideoRouter = express.Router()
|
const abuseVideoRouter = express.Router()
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { federateVideoIfNeeded } from '../../../lib/activitypub/videos'
|
||||||
import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
|
import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
|
||||||
import { CONFIG } from '../../../initializers/config'
|
import { CONFIG } from '../../../initializers/config'
|
||||||
import { sequelizeTypescript } from '../../../initializers/database'
|
import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { MVideoCaptionVideo } from '@server/typings/models'
|
import { MVideoCaptionVideo } from '@server/types/models'
|
||||||
|
|
||||||
const reqVideoCaptionAdd = createReqFiles(
|
const reqVideoCaptionAdd = createReqFiles(
|
||||||
[ 'captionfile' ],
|
[ 'captionfile' ],
|
||||||
|
|
|
@ -34,8 +34,8 @@ import {
|
||||||
MVideoTag,
|
MVideoTag,
|
||||||
MVideoThumbnailAccountDefault,
|
MVideoThumbnailAccountDefault,
|
||||||
MVideoWithBlacklistLight
|
MVideoWithBlacklistLight
|
||||||
} from '@server/typings/models'
|
} from '@server/types/models'
|
||||||
import { MVideoImport, MVideoImportFormattable } from '@server/typings/models/video/video-import'
|
import { MVideoImport, MVideoImportFormattable } from '@server/types/models/video/video-import'
|
||||||
|
|
||||||
const auditLogger = auditLoggerFactory('video-imports')
|
const auditLogger = auditLoggerFactory('video-imports')
|
||||||
const videoImportsRouter = express.Router()
|
const videoImportsRouter = express.Router()
|
||||||
|
|
|
@ -58,7 +58,7 @@ import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { createVideoMiniatureFromExisting, generateVideoMiniature } from '../../../lib/thumbnail'
|
import { createVideoMiniatureFromExisting, generateVideoMiniature } from '../../../lib/thumbnail'
|
||||||
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
|
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
|
||||||
import { Hooks } from '../../../lib/plugins/hooks'
|
import { Hooks } from '../../../lib/plugins/hooks'
|
||||||
import { MVideoDetails, MVideoFullLight } from '@server/typings/models'
|
import { MVideoDetails, MVideoFullLight } from '@server/types/models'
|
||||||
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
||||||
import { getVideoFilePath } from '@server/lib/video-paths'
|
import { getVideoFilePath } from '@server/lib/video-paths'
|
||||||
import toInt from 'validator/lib/toInt'
|
import toInt from 'validator/lib/toInt'
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { getFormattedObjects } from '../../../helpers/utils'
|
||||||
import { changeVideoChannelShare } from '../../../lib/activitypub/share'
|
import { changeVideoChannelShare } from '../../../lib/activitypub/share'
|
||||||
import { sendUpdateVideo } from '../../../lib/activitypub/send'
|
import { sendUpdateVideo } from '../../../lib/activitypub/send'
|
||||||
import { VideoModel } from '../../../models/video/video'
|
import { VideoModel } from '../../../models/video/video'
|
||||||
import { MVideoFullLight } from '@server/typings/models'
|
import { MVideoFullLight } from '@server/types/models'
|
||||||
|
|
||||||
const ownershipVideoRouter = express.Router()
|
const ownershipVideoRouter = express.Router()
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { root } from '../helpers/core-utils'
|
||||||
import { CONFIG, isEmailEnabled } from '../initializers/config'
|
import { CONFIG, isEmailEnabled } from '../initializers/config'
|
||||||
import { getPreview, getVideoCaption } from './lazy-static'
|
import { getPreview, getVideoCaption } from './lazy-static'
|
||||||
import { VideoStreamingPlaylistType } from '@shared/models/videos/video-streaming-playlist.type'
|
import { VideoStreamingPlaylistType } from '@shared/models/videos/video-streaming-playlist.type'
|
||||||
import { MVideoFile, MVideoFullLight } from '@server/typings/models'
|
import { MVideoFile, MVideoFullLight } from '@server/types/models'
|
||||||
import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths'
|
import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths'
|
||||||
import { getThemeOrDefault } from '../lib/plugins/theme-utils'
|
import { getThemeOrDefault } from '../lib/plugins/theme-utils'
|
||||||
import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
|
import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants'
|
||||||
import { signJsonLDObject } from './peertube-crypto'
|
import { signJsonLDObject } from './peertube-crypto'
|
||||||
import { pageToStartAndCount } from './core-utils'
|
import { pageToStartAndCount } from './core-utils'
|
||||||
import { URL } from 'url'
|
import { URL } from 'url'
|
||||||
import { MActor, MVideoAccountLight } from '../typings/models'
|
import { MActor, MVideoAccountLight } from '../types/models'
|
||||||
import { ContextType } from '@shared/models/activitypub/context'
|
import { ContextType } from '@shared/models/activitypub/context'
|
||||||
|
|
||||||
function getContextData (type: ContextType) {
|
function getContextData (type: ContextType) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ActorModel } from '../models/activitypub/actor'
|
import { ActorModel } from '../models/activitypub/actor'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { MActorFull, MActorAccountChannelId } from '../typings/models'
|
import { MActorFull, MActorAccountChannelId } from '../types/models'
|
||||||
|
|
||||||
type ActorFetchByUrlType = 'all' | 'association-ids'
|
type ActorFetchByUrlType = 'all' | 'association-ids'
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { join } from 'path'
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import * as srt2vtt from 'srt-to-vtt'
|
import * as srt2vtt from 'srt-to-vtt'
|
||||||
import { createReadStream, createWriteStream, move, remove } from 'fs-extra'
|
import { createReadStream, createWriteStream, move, remove } from 'fs-extra'
|
||||||
import { MVideoCaptionFormattable } from '@server/typings/models'
|
import { MVideoCaptionFormattable } from '@server/types/models'
|
||||||
|
|
||||||
async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) {
|
async function moveAndProcessCaptionFile (physicalFile: { filename: string, path: string }, videoCaption: MVideoCaptionFormattable) {
|
||||||
const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR
|
const videoCaptionsDir = CONFIG.STORAGE.CAPTIONS_DIR
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Response } from 'express'
|
import { Response } from 'express'
|
||||||
import { VideoChangeOwnershipModel } from '../../models/video/video-change-ownership'
|
import { VideoChangeOwnershipModel } from '../../models/video/video-change-ownership'
|
||||||
import { MVideoChangeOwnershipFull } from '@server/typings/models/video/video-change-ownership'
|
import { MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
|
||||||
import { MUserId } from '@server/typings/models'
|
import { MUserId } from '@server/types/models'
|
||||||
|
|
||||||
export async function doesChangeVideoOwnershipExist (idArg: number | string, res: Response) {
|
export async function doesChangeVideoOwnershipExist (idArg: number | string, res: Response) {
|
||||||
const id = parseInt(idArg + '', 10)
|
const id = parseInt(idArg + '', 10)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Response } from 'express'
|
import { Response } from 'express'
|
||||||
import { AccountModel } from '../../models/account/account'
|
import { AccountModel } from '../../models/account/account'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { MAccountDefault } from '../../typings/models'
|
import { MAccountDefault } from '../../types/models'
|
||||||
|
|
||||||
function doesAccountIdExist (id: number, res: Response, sendNotFound = true) {
|
function doesAccountIdExist (id: number, res: Response, sendNotFound = true) {
|
||||||
const promise = AccountModel.load(id)
|
const promise = AccountModel.load(id)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Response } from 'express'
|
import { Response } from 'express'
|
||||||
import { VideoCaptionModel } from '../../models/video/video-caption'
|
import { VideoCaptionModel } from '../../models/video/video-caption'
|
||||||
import { MVideoId } from '@server/typings/models'
|
import { MVideoId } from '@server/types/models'
|
||||||
|
|
||||||
async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
|
async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
|
||||||
const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
|
const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as express from 'express'
|
import * as express from 'express'
|
||||||
import { VideoChannelModel } from '../../models/video/video-channel'
|
import { VideoChannelModel } from '../../models/video/video-channel'
|
||||||
import { MChannelAccountDefault } from '@server/typings/models'
|
import { MChannelAccountDefault } from '@server/types/models'
|
||||||
|
|
||||||
async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
|
async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
|
||||||
const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
|
const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as express from 'express'
|
import * as express from 'express'
|
||||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||||
import { MVideoPlaylist } from '../../typings/models/video/video-playlist'
|
import { MVideoPlaylist } from '../../types/models/video/video-playlist'
|
||||||
|
|
||||||
export type VideoPlaylistFetchType = 'summary' | 'all'
|
export type VideoPlaylistFetchType = 'summary' | 'all'
|
||||||
async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: VideoPlaylistFetchType = 'summary') {
|
async function doesVideoPlaylistExist (id: number | string, res: express.Response, fetchType: VideoPlaylistFetchType = 'summary') {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
MVideoImmutable,
|
MVideoImmutable,
|
||||||
MVideoThumbnail,
|
MVideoThumbnail,
|
||||||
MVideoWithRights
|
MVideoWithRights
|
||||||
} from '@server/typings/models'
|
} from '@server/types/models'
|
||||||
import { VideoFileModel } from '@server/models/video/video-file'
|
import { VideoFileModel } from '@server/models/video/video-file'
|
||||||
|
|
||||||
async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
|
async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { logger } from './logger'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { createSign, createVerify } from 'crypto'
|
import { createSign, createVerify } from 'crypto'
|
||||||
import * as bcrypt from 'bcrypt'
|
import * as bcrypt from 'bcrypt'
|
||||||
import { MActor } from '../typings/models'
|
import { MActor } from '../types/models'
|
||||||
|
|
||||||
const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare)
|
const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare)
|
||||||
const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt)
|
const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt)
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
MVideoImmutable,
|
MVideoImmutable,
|
||||||
MVideoThumbnail,
|
MVideoThumbnail,
|
||||||
MVideoWithRights
|
MVideoWithRights
|
||||||
} from '@server/typings/models'
|
} from '@server/types/models'
|
||||||
import { Response } from 'express'
|
import { Response } from 'express'
|
||||||
import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants'
|
import { DEFAULT_AUDIO_RESOLUTION } from '@server/initializers/constants'
|
||||||
import { JobQueue } from '@server/lib/job-queue'
|
import { JobQueue } from '@server/lib/job-queue'
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { ActorModel } from '../models/activitypub/actor'
|
||||||
import { isTestInstance } from './core-utils'
|
import { isTestInstance } from './core-utils'
|
||||||
import { isActivityPubUrlValid } from './custom-validators/activitypub/misc'
|
import { isActivityPubUrlValid } from './custom-validators/activitypub/misc'
|
||||||
import { WEBSERVER } from '../initializers/constants'
|
import { WEBSERVER } from '../initializers/constants'
|
||||||
import { MActorFull } from '../typings/models'
|
import { MActorFull } from '../types/models'
|
||||||
|
|
||||||
const webfinger = new WebFinger({
|
const webfinger = new WebFinger({
|
||||||
webfist_fallback: false,
|
webfist_fallback: false,
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { CONFIG } from '../initializers/config'
|
||||||
import { dirname, join } from 'path'
|
import { dirname, join } from 'path'
|
||||||
import * as createTorrent from 'create-torrent'
|
import * as createTorrent from 'create-torrent'
|
||||||
import { promisify2 } from './core-utils'
|
import { promisify2 } from './core-utils'
|
||||||
import { MVideo } from '@server/typings/models/video/video'
|
import { MVideo } from '@server/types/models/video/video'
|
||||||
import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/typings/models/video/video-file'
|
import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file'
|
||||||
import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/typings/models/video/video-streaming-playlist'
|
import { isStreamingPlaylist, MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist'
|
||||||
import { WEBSERVER } from '@server/initializers/constants'
|
import { WEBSERVER } from '@server/initializers/constants'
|
||||||
import * as parseTorrent from 'parse-torrent'
|
import * as parseTorrent from 'parse-torrent'
|
||||||
import * as magnetUtil from 'magnet-uri'
|
import * as magnetUtil from 'magnet-uri'
|
||||||
|
|
|
@ -33,7 +33,7 @@ import {
|
||||||
MActorFullActor,
|
MActorFullActor,
|
||||||
MActorId,
|
MActorId,
|
||||||
MChannel
|
MChannel
|
||||||
} from '../../typings/models'
|
} from '../../types/models'
|
||||||
import { extname } from 'path'
|
import { extname } from 'path'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { ACTIVITY_PUB } from '../../initializers/constants'
|
||||||
import { ActorModel } from '../../models/activitypub/actor'
|
import { ActorModel } from '../../models/activitypub/actor'
|
||||||
import { VideoModel } from '../../models/video/video'
|
import { VideoModel } from '../../models/video/video'
|
||||||
import { VideoShareModel } from '../../models/video/video-share'
|
import { VideoShareModel } from '../../models/video/video-share'
|
||||||
import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../typings/models'
|
import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../types/models'
|
||||||
|
|
||||||
function getRemoteVideoAudience (accountActor: MActorUrl, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience {
|
function getRemoteVideoAudience (accountActor: MActorUrl, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { CacheFileObject } from '../../../shared/index'
|
||||||
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
|
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
|
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
|
||||||
import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/typings/models'
|
import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models'
|
||||||
|
|
||||||
function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId) {
|
function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId) {
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { MActorFollowActors } from '../../typings/models'
|
import { MActorFollowActors } from '../../types/models'
|
||||||
import { CONFIG } from '../../initializers/config'
|
import { CONFIG } from '../../initializers/config'
|
||||||
import { SERVER_ACTOR_NAME } from '../../initializers/constants'
|
import { SERVER_ACTOR_NAME } from '../../initializers/constants'
|
||||||
import { JobQueue } from '../job-queue'
|
import { JobQueue } from '../job-queue'
|
||||||
|
|
|
@ -15,9 +15,9 @@ import { VideoPlaylistElementModel } from '../../models/video/video-playlist-ele
|
||||||
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||||
import { sequelizeTypescript } from '../../initializers/database'
|
import { sequelizeTypescript } from '../../initializers/database'
|
||||||
import { createPlaylistMiniatureFromUrl } from '../thumbnail'
|
import { createPlaylistMiniatureFromUrl } from '../thumbnail'
|
||||||
import { FilteredModelAttributes } from '../../typings/sequelize'
|
import { FilteredModelAttributes } from '../../types/sequelize'
|
||||||
import { MAccountDefault, MAccountId, MVideoId } from '../../typings/models'
|
import { MAccountDefault, MAccountId, MVideoId } from '../../types/models'
|
||||||
import { MVideoPlaylist, MVideoPlaylistId, MVideoPlaylistOwner } from '../../typings/models/video/video-playlist'
|
import { MVideoPlaylist, MVideoPlaylistId, MVideoPlaylistOwner } from '../../types/models/video/video-playlist'
|
||||||
|
|
||||||
function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) {
|
function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) {
|
||||||
const privacy = to.includes(ACTIVITY_PUB.PUBLIC)
|
const privacy = to.includes(ACTIVITY_PUB.PUBLIC)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ActivityAccept } from '../../../../shared/models/activitypub'
|
import { ActivityAccept } from '../../../../shared/models/activitypub'
|
||||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { addFetchOutboxJob } from '../actor'
|
import { addFetchOutboxJob } from '../actor'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorDefault, MActorSignature } from '../../../typings/models'
|
import { MActorDefault, MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
async function processAcceptActivity (options: APProcessorOptions<ActivityAccept>) {
|
async function processAcceptActivity (options: APProcessorOptions<ActivityAccept>) {
|
||||||
const { byActor: targetActor, inboxActor } = options
|
const { byActor: targetActor, inboxActor } = options
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models'
|
import { MActorSignature, MVideoAccountLightBlacklistAllFiles } from '../../../types/models'
|
||||||
|
|
||||||
async function processAnnounceActivity (options: APProcessorOptions<ActivityAnnounce>) {
|
async function processAnnounceActivity (options: APProcessorOptions<ActivityAnnounce>) {
|
||||||
const { activity, byActor: actorAnnouncer } = options
|
const { activity, byActor: actorAnnouncer } = options
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { VideoCommentObject } from '../../../../shared/models/activitypub/object
|
||||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { sequelizeTypescript } from '../../../initializers/database'
|
import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models'
|
import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../types/models'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { createOrUpdateCacheFile } from '../cache-file'
|
import { createOrUpdateCacheFile } from '../cache-file'
|
||||||
import { createOrUpdateVideoPlaylist } from '../playlist'
|
import { createOrUpdateVideoPlaylist } from '../playlist'
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { markCommentAsDeleted } from '../../video-comment'
|
import { markCommentAsDeleted } from '../../video-comment'
|
||||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
|
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor } from '../../../typings/models'
|
import { MAccountActor, MActor, MActorSignature, MChannelActor, MChannelActorAccountActor } from '../../../types/models'
|
||||||
|
|
||||||
async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) {
|
async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) {
|
||||||
const { activity, byActor } = options
|
const { activity, byActor } = options
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { getVideoDislikeActivityPubUrl } from '../url'
|
import { getVideoDislikeActivityPubUrl } from '../url'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature } from '../../../typings/models'
|
import { MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
async function processDislikeActivity (options: APProcessorOptions<ActivityCreate | ActivityDislike>) {
|
async function processDislikeActivity (options: APProcessorOptions<ActivityCreate | ActivityDislike>) {
|
||||||
const { activity, byActor } = options
|
const { activity, byActor } = options
|
||||||
|
|
|
@ -7,8 +7,8 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse'
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { getAPId } from '../../../helpers/activitypub'
|
import { getAPId } from '../../../helpers/activitypub'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature, MVideoAbuseAccountVideo } from '../../../typings/models'
|
import { MActorSignature, MVideoAbuseAccountVideo } from '../../../types/models'
|
||||||
import { AccountModel } from '@server/models/account/account'
|
import { AccountModel } from '@server/models/account/account'
|
||||||
|
|
||||||
async function processFlagActivity (options: APProcessorOptions<ActivityCreate | ActivityFlag>) {
|
async function processFlagActivity (options: APProcessorOptions<ActivityCreate | ActivityFlag>) {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { sendAccept, sendReject } from '../send'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { getAPId } from '../../../helpers/activitypub'
|
import { getAPId } from '../../../helpers/activitypub'
|
||||||
import { CONFIG } from '../../../initializers/config'
|
import { CONFIG } from '../../../initializers/config'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorFollowActors, MActorSignature } from '../../../typings/models'
|
import { MActorFollowActors, MActorSignature } from '../../../types/models'
|
||||||
import { autoFollowBackIfNeeded } from '../follow'
|
import { autoFollowBackIfNeeded } from '../follow'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { getVideoLikeActivityPubUrl } from '../url'
|
import { getVideoLikeActivityPubUrl } from '../url'
|
||||||
import { getAPId } from '../../../helpers/activitypub'
|
import { getAPId } from '../../../helpers/activitypub'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature } from '../../../typings/models'
|
import { MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
async function processLikeActivity (options: APProcessorOptions<ActivityLike>) {
|
async function processLikeActivity (options: APProcessorOptions<ActivityLike>) {
|
||||||
const { activity, byActor } = options
|
const { activity, byActor } = options
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ActivityReject } from '../../../../shared/models/activitypub/activity'
|
import { ActivityReject } from '../../../../shared/models/activitypub/activity'
|
||||||
import { sequelizeTypescript } from '../../../initializers/database'
|
import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActor } from '../../../typings/models'
|
import { MActor } from '../../../types/models'
|
||||||
|
|
||||||
async function processRejectActivity (options: APProcessorOptions<ActivityReject>) {
|
async function processRejectActivity (options: APProcessorOptions<ActivityReject>) {
|
||||||
const { byActor: targetActor, inboxActor } = options
|
const { byActor: targetActor, inboxActor } = options
|
||||||
|
|
|
@ -10,8 +10,8 @@ import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { VideoShareModel } from '../../../models/video/video-share'
|
import { VideoShareModel } from '../../../models/video/video-share'
|
||||||
import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
|
import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature } from '../../../typings/models'
|
import { MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
async function processUndoActivity (options: APProcessorOptions<ActivityUndo>) {
|
async function processUndoActivity (options: APProcessorOptions<ActivityUndo>) {
|
||||||
const { activity, byActor } = options
|
const { activity, byActor } = options
|
||||||
|
|
|
@ -14,8 +14,8 @@ import { createOrUpdateCacheFile } from '../cache-file'
|
||||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
|
import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
|
||||||
import { createOrUpdateVideoPlaylist } from '../playlist'
|
import { createOrUpdateVideoPlaylist } from '../playlist'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature, MAccountIdActor } from '../../../typings/models'
|
import { MActorSignature, MAccountIdActor } from '../../../types/models'
|
||||||
import { isRedundancyAccepted } from '@server/lib/redundancy'
|
import { isRedundancyAccepted } from '@server/lib/redundancy'
|
||||||
|
|
||||||
async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) {
|
async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) {
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
import { Redis } from '../../redis'
|
import { Redis } from '../../redis'
|
||||||
import { ActivityCreate, ActivityView, ViewObject } from '../../../../shared/models/activitypub'
|
import { ActivityCreate, ActivityView, ViewObject } from '../../../../shared/models/activitypub'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorSignature } from '../../../typings/models'
|
import { MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
async function processViewActivity (options: APProcessorOptions<ActivityCreate | ActivityView>) {
|
async function processViewActivity (options: APProcessorOptions<ActivityCreate | ActivityView>) {
|
||||||
const { activity, byActor } = options
|
const { activity, byActor } = options
|
||||||
|
|
|
@ -14,8 +14,8 @@ import { getOrCreateActorAndServerAndModel } from '../actor'
|
||||||
import { processDislikeActivity } from './process-dislike'
|
import { processDislikeActivity } from './process-dislike'
|
||||||
import { processFlagActivity } from './process-flag'
|
import { processFlagActivity } from './process-flag'
|
||||||
import { processViewActivity } from './process-view'
|
import { processViewActivity } from './process-view'
|
||||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MActorDefault, MActorSignature } from '../../../typings/models'
|
import { MActorDefault, MActorSignature } from '../../../types/models'
|
||||||
|
|
||||||
const processActivity: { [ P in ActivityType ]: (options: APProcessorOptions<Activity>) => Promise<any> } = {
|
const processActivity: { [ P in ActivityType ]: (options: APProcessorOptions<Activity>) => Promise<any> } = {
|
||||||
Create: processCreateActivity,
|
Create: processCreateActivity,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { getActorFollowAcceptActivityPubUrl, getActorFollowActivityPubUrl } from
|
||||||
import { unicastTo } from './utils'
|
import { unicastTo } from './utils'
|
||||||
import { buildFollowActivity } from './send-follow'
|
import { buildFollowActivity } from './send-follow'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { MActor, MActorFollowActors } from '../../../typings/models'
|
import { MActor, MActorFollowActors } from '../../../types/models'
|
||||||
|
|
||||||
function sendAccept (actorFollow: MActorFollowActors) {
|
function sendAccept (actorFollow: MActorFollowActors) {
|
||||||
const follower = actorFollow.ActorFollower
|
const follower = actorFollow.ActorFollower
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ActivityAnnounce, ActivityAudience } from '../../../../shared/models/ac
|
||||||
import { broadcastToFollowers } from './utils'
|
import { broadcastToFollowers } from './utils'
|
||||||
import { audiencify, getActorsInvolvedInVideo, getAudience, getAudienceFromFollowersOf } from '../audience'
|
import { audiencify, getActorsInvolvedInVideo, getAudience, getAudienceFromFollowersOf } from '../audience'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { MActorLight, MVideo } from '../../../typings/models'
|
import { MActorLight, MVideo } from '../../../types/models'
|
||||||
import { MVideoShare } from '../../../typings/models/video'
|
import { MVideoShare } from '../../../types/models/video'
|
||||||
|
|
||||||
async function buildAnnounceWithVideoAudience (
|
async function buildAnnounceWithVideoAudience (
|
||||||
byActor: MActorLight,
|
byActor: MActorLight,
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
MVideoPlaylistFull,
|
MVideoPlaylistFull,
|
||||||
MVideoRedundancyFileVideo,
|
MVideoRedundancyFileVideo,
|
||||||
MVideoRedundancyStreamingPlaylistVideo
|
MVideoRedundancyStreamingPlaylistVideo
|
||||||
} from '../../../typings/models'
|
} from '../../../types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { ContextType } from '@shared/models/activitypub/context'
|
import { ContextType } from '@shared/models/activitypub/context'
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { logger } from '../../../helpers/logger'
|
||||||
import { ActorModel } from '../../../models/activitypub/actor'
|
import { ActorModel } from '../../../models/activitypub/actor'
|
||||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { VideoShareModel } from '../../../models/video/video-share'
|
import { VideoShareModel } from '../../../models/video/video-share'
|
||||||
import { MActorUrl } from '../../../typings/models'
|
import { MActorUrl } from '../../../types/models'
|
||||||
import { MCommentOwnerVideo, MVideoAccountLight, MVideoPlaylistFullSummary } from '../../../typings/models/video'
|
import { MCommentOwnerVideo, MVideoAccountLight, MVideoPlaylistFullSummary } from '../../../types/models/video'
|
||||||
import { audiencify, getActorsInvolvedInVideo, getVideoCommentAudience } from '../audience'
|
import { audiencify, getActorsInvolvedInVideo, getVideoCommentAudience } from '../audience'
|
||||||
import { getDeleteActivityPubUrl } from '../url'
|
import { getDeleteActivityPubUrl } from '../url'
|
||||||
import { broadcastToActors, broadcastToFollowers, sendVideoRelatedActivity, unicastTo } from './utils'
|
import { broadcastToActors, broadcastToFollowers, sendVideoRelatedActivity, unicastTo } from './utils'
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { logger } from '../../../helpers/logger'
|
||||||
import { ActivityAudience, ActivityDislike } from '../../../../shared/models/activitypub'
|
import { ActivityAudience, ActivityDislike } from '../../../../shared/models/activitypub'
|
||||||
import { sendVideoRelatedActivity } from './utils'
|
import { sendVideoRelatedActivity } from './utils'
|
||||||
import { audiencify, getAudience } from '../audience'
|
import { audiencify, getAudience } from '../audience'
|
||||||
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../typings/models'
|
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../types/models'
|
||||||
|
|
||||||
function sendDislike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
|
function sendDislike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
|
||||||
logger.info('Creating job to dislike %s.', video.url)
|
logger.info('Creating job to dislike %s.', video.url)
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { logger } from '../../../helpers/logger'
|
||||||
import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub'
|
import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub'
|
||||||
import { audiencify, getAudience } from '../audience'
|
import { audiencify, getAudience } from '../audience'
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
import { MActor, MVideoFullLight } from '../../../typings/models'
|
import { MActor, MVideoFullLight } from '../../../types/models'
|
||||||
import { MVideoAbuseVideo } from '../../../typings/models/video'
|
import { MVideoAbuseVideo } from '../../../types/models/video'
|
||||||
|
|
||||||
function sendVideoAbuse (byActor: MActor, videoAbuse: MVideoAbuseVideo, video: MVideoFullLight, t: Transaction) {
|
function sendVideoAbuse (byActor: MActor, videoAbuse: MVideoAbuseVideo, video: MVideoFullLight, t: Transaction) {
|
||||||
if (!video.VideoChannel.Account.Actor.serverId) return // Local user
|
if (!video.VideoChannel.Account.Actor.serverId) return // Local user
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { getActorFollowActivityPubUrl } from '../url'
|
||||||
import { unicastTo } from './utils'
|
import { unicastTo } from './utils'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
import { MActor, MActorFollowActors } from '../../../typings/models'
|
import { MActor, MActorFollowActors } from '../../../types/models'
|
||||||
|
|
||||||
function sendFollow (actorFollow: MActorFollowActors, t: Transaction) {
|
function sendFollow (actorFollow: MActorFollowActors, t: Transaction) {
|
||||||
const me = actorFollow.ActorFollower
|
const me = actorFollow.ActorFollower
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { getVideoLikeActivityPubUrl } from '../url'
|
||||||
import { sendVideoRelatedActivity } from './utils'
|
import { sendVideoRelatedActivity } from './utils'
|
||||||
import { audiencify, getAudience } from '../audience'
|
import { audiencify, getAudience } from '../audience'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../typings/models'
|
import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../types/models'
|
||||||
|
|
||||||
function sendLike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
|
function sendLike (byActor: MActor, video: MVideoAccountLight, t: Transaction) {
|
||||||
logger.info('Creating job to like %s.', video.url)
|
logger.info('Creating job to like %s.', video.url)
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { getActorFollowActivityPubUrl, getActorFollowRejectActivityPubUrl } from
|
||||||
import { unicastTo } from './utils'
|
import { unicastTo } from './utils'
|
||||||
import { buildFollowActivity } from './send-follow'
|
import { buildFollowActivity } from './send-follow'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { MActor } from '../../../typings/models'
|
import { MActor } from '../../../types/models'
|
||||||
|
|
||||||
function sendReject (follower: MActor, following: MActor) {
|
function sendReject (follower: MActor, following: MActor) {
|
||||||
if (!follower.serverId) { // This should never happen
|
if (!follower.serverId) { // This should never happen
|
||||||
|
|
|
@ -26,7 +26,7 @@ import {
|
||||||
MVideoAccountLight,
|
MVideoAccountLight,
|
||||||
MVideoRedundancyVideo,
|
MVideoRedundancyVideo,
|
||||||
MVideoShare
|
MVideoShare
|
||||||
} from '../../../typings/models'
|
} from '../../../types/models'
|
||||||
|
|
||||||
function sendUndoFollow (actorFollow: MActorFollowActors, t: Transaction) {
|
function sendUndoFollow (actorFollow: MActorFollowActors, t: Transaction) {
|
||||||
const me = actorFollow.ActorFollower
|
const me = actorFollow.ActorFollower
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
MVideoAPWithoutCaption,
|
MVideoAPWithoutCaption,
|
||||||
MVideoPlaylistFull,
|
MVideoPlaylistFull,
|
||||||
MVideoRedundancyVideo
|
MVideoRedundancyVideo
|
||||||
} from '../../../typings/models'
|
} from '../../../types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
async function sendUpdateVideo (videoArg: MVideoAPWithoutCaption, t: Transaction, overrodeByActor?: MActor) {
|
async function sendUpdateVideo (videoArg: MVideoAPWithoutCaption, t: Transaction, overrodeByActor?: MActor) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { getVideoLikeActivityPubUrl } from '../url'
|
||||||
import { sendVideoRelatedActivity } from './utils'
|
import { sendVideoRelatedActivity } from './utils'
|
||||||
import { audiencify, getAudience } from '../audience'
|
import { audiencify, getAudience } from '../audience'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
import { MActorAudience, MVideoImmutable, MVideoUrl } from '@server/typings/models'
|
import { MActorAudience, MVideoImmutable, MVideoUrl } from '@server/types/models'
|
||||||
|
|
||||||
async function sendView (byActor: ActorModel, video: MVideoImmutable, t: Transaction) {
|
async function sendView (byActor: ActorModel, video: MVideoImmutable, t: Transaction) {
|
||||||
logger.info('Creating job to send view of %s.', video.url)
|
logger.info('Creating job to send view of %s.', video.url)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { JobQueue } from '../../job-queue'
|
import { JobQueue } from '../../job-queue'
|
||||||
import { getActorsInvolvedInVideo, getAudienceFromFollowersOf, getRemoteVideoAudience } from '../audience'
|
import { getActorsInvolvedInVideo, getAudienceFromFollowersOf, getRemoteVideoAudience } from '../audience'
|
||||||
import { afterCommitIfTransaction } from '../../../helpers/database-utils'
|
import { afterCommitIfTransaction } from '../../../helpers/database-utils'
|
||||||
import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../typings/models'
|
import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { ContextType } from '@shared/models/activitypub/context'
|
import { ContextType } from '@shared/models/activitypub/context'
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { getOrCreateActorAndServerAndModel } from './actor'
|
||||||
import { logger } from '../../helpers/logger'
|
import { logger } from '../../helpers/logger'
|
||||||
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
|
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
|
||||||
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
|
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
|
||||||
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models/video'
|
import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../types/models/video'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
async function shareVideoByServerAndChannel (video: MVideoAccountLight, t: Transaction) {
|
async function shareVideoByServerAndChannel (video: MVideoAccountLight, t: Transaction) {
|
||||||
|
|
|
@ -9,10 +9,10 @@ import {
|
||||||
MVideoId,
|
MVideoId,
|
||||||
MVideoUrl,
|
MVideoUrl,
|
||||||
MVideoUUID
|
MVideoUUID
|
||||||
} from '../../typings/models'
|
} from '../../types/models'
|
||||||
import { MVideoPlaylist, MVideoPlaylistUUID } from '../../typings/models/video/video-playlist'
|
import { MVideoPlaylist, MVideoPlaylistUUID } from '../../types/models/video/video-playlist'
|
||||||
import { MVideoFileVideoUUID } from '../../typings/models/video/video-file'
|
import { MVideoFileVideoUUID } from '../../types/models/video/video-file'
|
||||||
import { MStreamingPlaylist } from '../../typings/models/video/video-streaming-playlist'
|
import { MStreamingPlaylist } from '../../types/models/video/video-streaming-playlist'
|
||||||
|
|
||||||
function getVideoActivityPubUrl (video: MVideoUUID) {
|
function getVideoActivityPubUrl (video: MVideoUUID) {
|
||||||
return WEBSERVER.URL + '/videos/watch/' + video.uuid
|
return WEBSERVER.URL + '/videos/watch/' + video.uuid
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { getOrCreateActorAndServerAndModel } from './actor'
|
||||||
import { getOrCreateVideoAndAccountAndChannel } from './videos'
|
import { getOrCreateVideoAndAccountAndChannel } from './videos'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { checkUrlsSameHost } from '../../helpers/activitypub'
|
import { checkUrlsSameHost } from '../../helpers/activitypub'
|
||||||
import { MCommentOwner, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../typings/models/video'
|
import { MCommentOwner, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../types/models/video'
|
||||||
|
|
||||||
type ResolveThreadParams = {
|
type ResolveThreadParams = {
|
||||||
url: string
|
url: string
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { doRequest } from '../../helpers/requests'
|
||||||
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
|
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
|
||||||
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url'
|
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url'
|
||||||
import { sendDislike } from './send/send-dislike'
|
import { sendDislike } from './send/send-dislike'
|
||||||
import { MAccountActor, MActorUrl, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models'
|
import { MAccountActor, MActorUrl, MVideo, MVideoAccountLight, MVideoId } from '../../types/models'
|
||||||
|
|
||||||
async function createRates (ratesUrl: string[], video: MVideo, rate: VideoRateType) {
|
async function createRates (ratesUrl: string[], video: MVideo, rate: VideoRateType) {
|
||||||
let rateCounts = 0
|
let rateCounts = 0
|
||||||
|
|
|
@ -52,7 +52,7 @@ import { sequelizeTypescript } from '../../initializers/database'
|
||||||
import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '../thumbnail'
|
import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '../thumbnail'
|
||||||
import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
|
import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { FilteredModelAttributes } from '../../typings/sequelize'
|
import { FilteredModelAttributes } from '../../types/sequelize'
|
||||||
import { autoBlacklistVideoIfNeeded } from '../video-blacklist'
|
import { autoBlacklistVideoIfNeeded } from '../video-blacklist'
|
||||||
import { ActorFollowScoreCache } from '../files-cache'
|
import { ActorFollowScoreCache } from '../files-cache'
|
||||||
import {
|
import {
|
||||||
|
@ -71,8 +71,8 @@ import {
|
||||||
MVideoId,
|
MVideoId,
|
||||||
MVideoImmutable,
|
MVideoImmutable,
|
||||||
MVideoThumbnail
|
MVideoThumbnail
|
||||||
} from '../../typings/models'
|
} from '../../types/models'
|
||||||
import { MThumbnail } from '../../typings/models/video/thumbnail'
|
import { MThumbnail } from '../../types/models/video/thumbnail'
|
||||||
import { maxBy, minBy } from 'lodash'
|
import { maxBy, minBy } from 'lodash'
|
||||||
|
|
||||||
async function federateVideoIfNeeded (videoArg: MVideoAPWithoutCaption, isNewVideo: boolean, transaction?: sequelize.Transaction) {
|
async function federateVideoIfNeeded (videoArg: MVideoAPWithoutCaption, isNewVideo: boolean, transaction?: sequelize.Transaction) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { sequelizeTypescript } from '../initializers/database'
|
||||||
import * as LRUCache from 'lru-cache'
|
import * as LRUCache from 'lru-cache'
|
||||||
import { queue } from 'async'
|
import { queue } from 'async'
|
||||||
import { downloadImage } from '../helpers/requests'
|
import { downloadImage } from '../helpers/requests'
|
||||||
import { MAccountDefault, MChannelDefault } from '../typings/models'
|
import { MAccountDefault, MChannelDefault } from '../types/models'
|
||||||
|
|
||||||
async function updateActorAvatarFile (
|
async function updateActorAvatarFile (
|
||||||
avatarPhysicalFile: Express.Multer.File,
|
avatarPhysicalFile: Express.Multer.File,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { sequelizeTypescript } from '@server/initializers/database'
|
import { sequelizeTypescript } from '@server/initializers/database'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { MAccountBlocklist, MAccountId, MAccountServer, MServerBlocklist } from '@server/typings/models'
|
import { MAccountBlocklist, MAccountId, MAccountServer, MServerBlocklist } from '@server/types/models'
|
||||||
import { AccountBlocklistModel } from '../models/account/account-blocklist'
|
import { AccountBlocklistModel } from '../models/account/account-blocklist'
|
||||||
import { ServerBlocklistModel } from '../models/server/server-blocklist'
|
import { ServerBlocklistModel } from '../models/server/server-blocklist'
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { VideoChannelModel } from '../models/video/video-channel'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
import { MAccountActor, MChannelActor, MVideo } from '../typings/models'
|
import { MAccountActor, MChannelActor, MVideo } from '../types/models'
|
||||||
|
|
||||||
export class ClientHtml {
|
export class ClientHtml {
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ import {
|
||||||
MVideoAccountLight,
|
MVideoAccountLight,
|
||||||
MVideoBlacklistLightVideo,
|
MVideoBlacklistLightVideo,
|
||||||
MVideoBlacklistVideo
|
MVideoBlacklistVideo
|
||||||
} from '../typings/models/video'
|
} from '../types/models/video'
|
||||||
import { MActorFollowActors, MActorFollowFull, MUser } from '../typings/models'
|
import { MActorFollowActors, MActorFollowFull, MUser } from '../types/models'
|
||||||
import { MVideoImport, MVideoImportVideo } from '@server/typings/models/video/video-import'
|
import { MVideoImport, MVideoImportVideo } from '@server/types/models/video/video-import'
|
||||||
import { EmailPayload } from '@shared/models'
|
import { EmailPayload } from '@shared/models'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { VideoAbuse } from '../../shared/models/videos'
|
import { VideoAbuse } from '../../shared/models/videos'
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { flatten, uniq } from 'lodash'
|
||||||
import { VideoFileModel } from '../models/video/video-file'
|
import { VideoFileModel } from '../models/video/video-file'
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import { sequelizeTypescript } from '../initializers/database'
|
import { sequelizeTypescript } from '../initializers/database'
|
||||||
import { MVideoWithFile } from '@server/typings/models'
|
import { MVideoWithFile } from '@server/types/models'
|
||||||
import { getVideoFilename, getVideoFilePath } from './video-paths'
|
import { getVideoFilename, getVideoFilePath } from './video-paths'
|
||||||
|
|
||||||
async function updateStreamingPlaylistsInfohashesIfNeeded () {
|
async function updateStreamingPlaylistsInfohashesIfNeeded () {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||||
import { ActorModel } from '../../../models/activitypub/actor'
|
import { ActorModel } from '../../../models/activitypub/actor'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { sequelizeTypescript } from '../../../initializers/database'
|
import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { MActor, MActorFollowActors, MActorFull } from '../../../typings/models'
|
import { MActor, MActorFollowActors, MActorFull } from '../../../types/models'
|
||||||
import { ActivitypubFollowPayload } from '@shared/models'
|
import { ActivitypubFollowPayload } from '@shared/models'
|
||||||
|
|
||||||
async function processActivityPubFollow (job: Bull.Job) {
|
async function processActivityPubFollow (job: Bull.Job) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { AccountModel } from '../../../models/account/account'
|
||||||
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
|
import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
|
||||||
import { VideoShareModel } from '../../../models/video/video-share'
|
import { VideoShareModel } from '../../../models/video/video-share'
|
||||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { MAccountDefault, MVideoFullLight } from '../../../typings/models'
|
import { MAccountDefault, MVideoFullLight } from '../../../types/models'
|
||||||
import { ActivitypubHttpFetcherPayload, FetchType } from '@shared/models'
|
import { ActivitypubHttpFetcherPayload, FetchType } from '@shared/models'
|
||||||
|
|
||||||
async function processActivityPubHttpFetcher (job: Bull.Job) {
|
async function processActivityPubHttpFetcher (job: Bull.Job) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { buildSignedActivity } from '../../../../helpers/activitypub'
|
import { buildSignedActivity } from '../../../../helpers/activitypub'
|
||||||
import { ActorModel } from '../../../../models/activitypub/actor'
|
import { ActorModel } from '../../../../models/activitypub/actor'
|
||||||
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '../../../../initializers/constants'
|
import { ACTIVITY_PUB, HTTP_SIGNATURE } from '../../../../initializers/constants'
|
||||||
import { MActor } from '../../../../typings/models'
|
import { MActor } from '../../../../types/models'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { buildDigest } from '@server/helpers/peertube-crypto'
|
import { buildDigest } from '@server/helpers/peertube-crypto'
|
||||||
import { ContextType } from '@shared/models/activitypub/context'
|
import { ContextType } from '@shared/models/activitypub/context'
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg
|
||||||
import { copy, stat } from 'fs-extra'
|
import { copy, stat } from 'fs-extra'
|
||||||
import { VideoFileModel } from '../../../models/video/video-file'
|
import { VideoFileModel } from '../../../models/video/video-file'
|
||||||
import { extname } from 'path'
|
import { extname } from 'path'
|
||||||
import { MVideoFile, MVideoWithFile } from '@server/typings/models'
|
import { MVideoFile, MVideoWithFile } from '@server/types/models'
|
||||||
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
||||||
import { getVideoFilePath } from '@server/lib/video-paths'
|
import { getVideoFilePath } from '@server/lib/video-paths'
|
||||||
import { VideoFileImportPayload } from '@shared/models'
|
import { VideoFileImportPayload } from '@shared/models'
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { addOptimizeOrMergeAudioJob } from '@server/helpers/video'
|
||||||
import { isPostImportVideoAccepted } from '@server/lib/moderation'
|
import { isPostImportVideoAccepted } from '@server/lib/moderation'
|
||||||
import { Hooks } from '@server/lib/plugins/hooks'
|
import { Hooks } from '@server/lib/plugins/hooks'
|
||||||
import { getVideoFilePath } from '@server/lib/video-paths'
|
import { getVideoFilePath } from '@server/lib/video-paths'
|
||||||
import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/typings/models/video/video-import'
|
import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import'
|
||||||
import {
|
import {
|
||||||
VideoImportPayload,
|
VideoImportPayload,
|
||||||
VideoImportTorrentPayload,
|
VideoImportTorrentPayload,
|
||||||
|
@ -27,7 +27,7 @@ import { sequelizeTypescript } from '../../../initializers/database'
|
||||||
import { VideoModel } from '../../../models/video/video'
|
import { VideoModel } from '../../../models/video/video'
|
||||||
import { VideoFileModel } from '../../../models/video/video-file'
|
import { VideoFileModel } from '../../../models/video/video-file'
|
||||||
import { VideoImportModel } from '../../../models/video/video-import'
|
import { VideoImportModel } from '../../../models/video/video-import'
|
||||||
import { MThumbnail } from '../../../typings/models/video/thumbnail'
|
import { MThumbnail } from '../../../types/models/video/thumbnail'
|
||||||
import { federateVideoIfNeeded } from '../../activitypub/videos'
|
import { federateVideoIfNeeded } from '../../activitypub/videos'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { generateVideoMiniature } from '../../thumbnail'
|
import { generateVideoMiniature } from '../../thumbnail'
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { computeResolutionsToTranscode } from '../../../helpers/ffmpeg-utils'
|
||||||
import { generateHlsPlaylist, mergeAudioVideofile, optimizeOriginalVideofile, transcodeNewResolution } from '../../video-transcoding'
|
import { generateHlsPlaylist, mergeAudioVideofile, optimizeOriginalVideofile, transcodeNewResolution } from '../../video-transcoding'
|
||||||
import { Notifier } from '../../notifier'
|
import { Notifier } from '../../notifier'
|
||||||
import { CONFIG } from '../../../initializers/config'
|
import { CONFIG } from '../../../initializers/config'
|
||||||
import { MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/typings/models'
|
import { MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models'
|
||||||
|
|
||||||
async function processVideoTranscoding (job: Bull.Job) {
|
async function processVideoTranscoding (job: Bull.Job) {
|
||||||
const payload = job.data as VideoTranscodingPayload
|
const payload = job.data as VideoTranscodingPayload
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { ActorModel } from '../models/activitypub/actor'
|
||||||
import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object'
|
import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object'
|
||||||
import { VideoFileModel } from '@server/models/video/video-file'
|
import { VideoFileModel } from '@server/models/video/video-file'
|
||||||
import { PathLike } from 'fs-extra'
|
import { PathLike } from 'fs-extra'
|
||||||
import { MUser } from '@server/typings/models'
|
import { MUser } from '@server/types/models'
|
||||||
|
|
||||||
export type AcceptResult = {
|
export type AcceptResult = {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
|
|
|
@ -7,8 +7,8 @@ import {
|
||||||
MUserNotifSettingAccount,
|
MUserNotifSettingAccount,
|
||||||
MUserWithNotificationSetting,
|
MUserWithNotificationSetting,
|
||||||
UserNotificationModelForApi
|
UserNotificationModelForApi
|
||||||
} from '@server/typings/models/user'
|
} from '@server/types/models/user'
|
||||||
import { MVideoImportVideo } from '@server/typings/models/video/video-import'
|
import { MVideoImportVideo } from '@server/types/models/video/video-import'
|
||||||
import { UserNotificationSettingValue, UserNotificationType, UserRight } from '../../shared/models/users'
|
import { UserNotificationSettingValue, UserNotificationType, UserRight } from '../../shared/models/users'
|
||||||
import { VideoAbuse, VideoPrivacy, VideoState } from '../../shared/models/videos'
|
import { VideoAbuse, VideoPrivacy, VideoState } from '../../shared/models/videos'
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
|
@ -16,7 +16,7 @@ import { CONFIG } from '../initializers/config'
|
||||||
import { AccountBlocklistModel } from '../models/account/account-blocklist'
|
import { AccountBlocklistModel } from '../models/account/account-blocklist'
|
||||||
import { UserModel } from '../models/account/user'
|
import { UserModel } from '../models/account/user'
|
||||||
import { UserNotificationModel } from '../models/account/user-notification'
|
import { UserNotificationModel } from '../models/account/user-notification'
|
||||||
import { MAccountServer, MActorFollowFull } from '../typings/models'
|
import { MAccountServer, MActorFollowFull } from '../types/models'
|
||||||
import {
|
import {
|
||||||
MCommentOwnerVideo,
|
MCommentOwnerVideo,
|
||||||
MVideoAbuseVideo,
|
MVideoAbuseVideo,
|
||||||
|
@ -24,7 +24,7 @@ import {
|
||||||
MVideoBlacklistLightVideo,
|
MVideoBlacklistLightVideo,
|
||||||
MVideoBlacklistVideo,
|
MVideoBlacklistVideo,
|
||||||
MVideoFullLight
|
MVideoFullLight
|
||||||
} from '../typings/models/video'
|
} from '../types/models/video'
|
||||||
import { isBlockedByServerOrAccount } from './blocklist'
|
import { isBlockedByServerOrAccount } from './blocklist'
|
||||||
import { Emailer } from './emailer'
|
import { Emailer } from './emailer'
|
||||||
import { PeerTubeSocket } from './peertube-socket'
|
import { PeerTubeSocket } from './peertube-socket'
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { LRU_CACHE } from '../initializers/constants'
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import * as LRUCache from 'lru-cache'
|
import * as LRUCache from 'lru-cache'
|
||||||
import { MOAuthTokenUser } from '@server/typings/models/oauth/oauth-token'
|
import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
|
||||||
import { MUser } from '@server/typings/models/user/user'
|
import { MUser } from '@server/types/models/user/user'
|
||||||
import { UserAdminFlag } from '@shared/models/users/user-flag.model'
|
import { UserAdminFlag } from '@shared/models/users/user-flag.model'
|
||||||
import { createUserAccountAndChannelAndPlaylist } from './user'
|
import { createUserAccountAndChannelAndPlaylist } from './user'
|
||||||
import { UserRole } from '@shared/models/users/user-role'
|
import { UserRole } from '@shared/models/users/user-role'
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as SocketIO from 'socket.io'
|
||||||
import { authenticateSocket } from '../middlewares'
|
import { authenticateSocket } from '../middlewares'
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
import { Server } from 'http'
|
import { Server } from 'http'
|
||||||
import { UserNotificationModelForApi } from '@server/typings/models/user'
|
import { UserNotificationModelForApi } from '@server/types/models/user'
|
||||||
|
|
||||||
class PeerTubeSocket {
|
class PeerTubeSocket {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { ClientHtml } from '../client-html'
|
||||||
import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model'
|
import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model'
|
||||||
import { RegisterHelpersStore } from './register-helpers-store'
|
import { RegisterHelpersStore } from './register-helpers-store'
|
||||||
import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model'
|
import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model'
|
||||||
import { MOAuthTokenUser, MUser } from '@server/typings/models'
|
import { MOAuthTokenUser, MUser } from '@server/types/models'
|
||||||
import { RegisterServerAuthPassOptions, RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
|
import { RegisterServerAuthPassOptions, RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
|
||||||
|
|
||||||
export interface RegisteredPlugin {
|
export interface RegisteredPlugin {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { VideoRedundancyModel } from '../models/redundancy/video-redundancy'
|
import { VideoRedundancyModel } from '../models/redundancy/video-redundancy'
|
||||||
import { sendUndoCacheFile } from './activitypub/send'
|
import { sendUndoCacheFile } from './activitypub/send'
|
||||||
import { Transaction } from 'sequelize'
|
import { Transaction } from 'sequelize'
|
||||||
import { MActorSignature, MVideoRedundancyVideo } from '@server/typings/models'
|
import { MActorSignature, MVideoRedundancyVideo } from '@server/types/models'
|
||||||
import { CONFIG } from '@server/initializers/config'
|
import { CONFIG } from '@server/initializers/config'
|
||||||
import { logger } from '@server/helpers/logger'
|
import { logger } from '@server/helpers/logger'
|
||||||
import { ActorFollowModel } from '@server/models/activitypub/actor-follow'
|
import { ActorFollowModel } from '@server/models/activitypub/actor-follow'
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { federateVideoIfNeeded } from '../activitypub/videos'
|
||||||
import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants'
|
import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants'
|
||||||
import { Notifier } from '../notifier'
|
import { Notifier } from '../notifier'
|
||||||
import { sequelizeTypescript } from '../../initializers/database'
|
import { sequelizeTypescript } from '../../initializers/database'
|
||||||
import { MVideoFullLight } from '@server/typings/models'
|
import { MVideoFullLight } from '@server/types/models'
|
||||||
|
|
||||||
export class UpdateVideosScheduler extends AbstractScheduler {
|
export class UpdateVideosScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {
|
||||||
MVideoRedundancyStreamingPlaylistVideo,
|
MVideoRedundancyStreamingPlaylistVideo,
|
||||||
MVideoRedundancyVideo,
|
MVideoRedundancyVideo,
|
||||||
MVideoWithAllFiles
|
MVideoWithAllFiles
|
||||||
} from '@server/typings/models'
|
} from '@server/types/models'
|
||||||
import { getVideoFilename } from '../video-paths'
|
import { getVideoFilename } from '../video-paths'
|
||||||
import { VideoModel } from '@server/models/video/video'
|
import { VideoModel } from '@server/models/video/video'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { ThumbnailType } from '../../shared/models/videos/thumbnail.type'
|
||||||
import { processImage } from '../helpers/image-utils'
|
import { processImage } from '../helpers/image-utils'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { downloadImage } from '../helpers/requests'
|
import { downloadImage } from '../helpers/requests'
|
||||||
import { MVideoPlaylistThumbnail } from '../typings/models/video/video-playlist'
|
import { MVideoPlaylistThumbnail } from '../types/models/video/video-playlist'
|
||||||
import { MVideoFile, MVideoThumbnail } from '../typings/models'
|
import { MVideoFile, MVideoThumbnail } from '../types/models'
|
||||||
import { MThumbnail } from '../typings/models/video/thumbnail'
|
import { MThumbnail } from '../types/models/video/thumbnail'
|
||||||
import { getVideoFilePath } from './video-paths'
|
import { getVideoFilePath } from './video-paths'
|
||||||
|
|
||||||
type ImageSize = { height: number, width: number }
|
type ImageSize = { height: number, width: number }
|
||||||
|
|
|
@ -12,8 +12,8 @@ import { sequelizeTypescript } from '../initializers/database'
|
||||||
import { Transaction } from 'sequelize/types'
|
import { Transaction } from 'sequelize/types'
|
||||||
import { Redis } from './redis'
|
import { Redis } from './redis'
|
||||||
import { Emailer } from './emailer'
|
import { Emailer } from './emailer'
|
||||||
import { MAccountDefault, MActorDefault, MChannelActor } from '../typings/models'
|
import { MAccountDefault, MActorDefault, MChannelActor } from '../types/models'
|
||||||
import { MUser, MUserDefault, MUserId } from '../typings/models/user'
|
import { MUser, MUserDefault, MUserId } from '../types/models/user'
|
||||||
import { getAccountActivityPubUrl } from './activitypub/url'
|
import { getAccountActivityPubUrl } from './activitypub/url'
|
||||||
|
|
||||||
type ChannelNames = { name: string, displayName: string }
|
type ChannelNames = { name: string, displayName: string }
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
MVideoBlacklistVideo,
|
MVideoBlacklistVideo,
|
||||||
MVideoFullLight,
|
MVideoFullLight,
|
||||||
MVideoWithBlacklistLight
|
MVideoWithBlacklistLight
|
||||||
} from '@server/typings/models'
|
} from '@server/types/models'
|
||||||
import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models'
|
import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models'
|
||||||
import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
|
import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { VideoChannelCreate } from '../../shared/models'
|
||||||
import { VideoChannelModel } from '../models/video/video-channel'
|
import { VideoChannelModel } from '../models/video/video-channel'
|
||||||
import { buildActorInstance } from './activitypub/actor'
|
import { buildActorInstance } from './activitypub/actor'
|
||||||
import { VideoModel } from '../models/video/video'
|
import { VideoModel } from '../models/video/video'
|
||||||
import { MAccountId, MChannelDefault, MChannelId } from '../typings/models'
|
import { MAccountId, MChannelDefault, MChannelId } from '../types/models'
|
||||||
import { getVideoChannelActivityPubUrl } from './activitypub/url'
|
import { getVideoChannelActivityPubUrl } from './activitypub/url'
|
||||||
import { federateVideoIfNeeded } from './activitypub/videos'
|
import { federateVideoIfNeeded } from './activitypub/videos'
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { sequelizeTypescript } from '@server/initializers/database'
|
||||||
import { ResultList } from '../../shared/models'
|
import { ResultList } from '../../shared/models'
|
||||||
import { VideoCommentThreadTree } from '../../shared/models/videos/video-comment.model'
|
import { VideoCommentThreadTree } from '../../shared/models/videos/video-comment.model'
|
||||||
import { VideoCommentModel } from '../models/video/video-comment'
|
import { VideoCommentModel } from '../models/video/video-comment'
|
||||||
import { MAccountDefault, MComment, MCommentOwnerVideoReply, MVideoFullLight, MCommentOwnerVideo } from '../typings/models'
|
import { MAccountDefault, MComment, MCommentOwnerVideoReply, MVideoFullLight, MCommentOwnerVideo } from '../types/models'
|
||||||
import { sendCreateVideoComment, sendDeleteVideoComment } from './activitypub/send'
|
import { sendCreateVideoComment, sendDeleteVideoComment } from './activitypub/send'
|
||||||
import { getVideoCommentActivityPubUrl } from './activitypub/url'
|
import { getVideoCommentActivityPubUrl } from './activitypub/url'
|
||||||
import { Hooks } from './plugins/hooks'
|
import { Hooks } from './plugins/hooks'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/typings/models'
|
import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { CONFIG } from '@server/initializers/config'
|
import { CONFIG } from '@server/initializers/config'
|
||||||
import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
|
import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { VideoPlaylistModel } from '../models/video/video-playlist'
|
||||||
import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
|
import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||||
import { getVideoPlaylistActivityPubUrl } from './activitypub/url'
|
import { getVideoPlaylistActivityPubUrl } from './activitypub/url'
|
||||||
import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
|
import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
|
||||||
import { MAccount } from '../typings/models'
|
import { MAccount } from '../types/models'
|
||||||
import { MVideoPlaylistOwner } from '../typings/models/video/video-playlist'
|
import { MVideoPlaylistOwner } from '../types/models/video/video-playlist'
|
||||||
|
|
||||||
async function createWatchLaterPlaylist (account: MAccount, t: Sequelize.Transaction) {
|
async function createWatchLaterPlaylist (account: MAccount, t: Sequelize.Transaction) {
|
||||||
const videoPlaylist: MVideoPlaylistOwner = new VideoPlaylistModel({
|
const videoPlaylist: MVideoPlaylistOwner = new VideoPlaylistModel({
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { updateMasterHLSPlaylist, updateSha256Segments } from './hls'
|
||||||
import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
|
import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
|
||||||
import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
|
import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/typings/models'
|
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models'
|
||||||
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
||||||
import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths'
|
import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths'
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { areValidationErrors } from './utils'
|
||||||
import { ActorModel } from '../../models/activitypub/actor'
|
import { ActorModel } from '../../models/activitypub/actor'
|
||||||
import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger'
|
import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger'
|
||||||
import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
|
import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
|
||||||
import { MActorFollowActorsDefault } from '@server/typings/models'
|
import { MActorFollowActorsDefault } from '@server/types/models'
|
||||||
import { isFollowStateValid } from '@server/helpers/custom-validators/follows'
|
import { isFollowStateValid } from '@server/helpers/custom-validators/follows'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
|
||||||
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
|
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
|
||||||
import { doesVideoExist } from '../../helpers/middlewares'
|
import { doesVideoExist } from '../../helpers/middlewares'
|
||||||
import { UserRole } from '../../../shared/models/users'
|
import { UserRole } from '../../../shared/models/users'
|
||||||
import { MUserDefault } from '@server/typings/models'
|
import { MUserDefault } from '@server/types/models'
|
||||||
import { Hooks } from '@server/lib/plugins/hooks'
|
import { Hooks } from '@server/lib/plugins/hooks'
|
||||||
|
|
||||||
const usersAddValidator = [
|
const usersAddValidator = [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as express from 'express'
|
import * as express from 'express'
|
||||||
import { body, param, query } from 'express-validator'
|
import { body, param, query } from 'express-validator'
|
||||||
import { VIDEO_CHANNELS } from '@server/initializers/constants'
|
import { VIDEO_CHANNELS } from '@server/initializers/constants'
|
||||||
import { MChannelAccountDefault, MUser } from '@server/typings/models'
|
import { MChannelAccountDefault, MUser } from '@server/types/models'
|
||||||
import { UserRight } from '../../../../shared'
|
import { UserRight } from '../../../../shared'
|
||||||
import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
|
import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
|
||||||
import { isBooleanValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc'
|
import { isBooleanValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as express from 'express'
|
import * as express from 'express'
|
||||||
import { body, param } from 'express-validator'
|
import { body, param } from 'express-validator'
|
||||||
import { MUserAccountUrl } from '@server/typings/models'
|
import { MUserAccountUrl } from '@server/types/models'
|
||||||
import { UserRight } from '../../../../shared'
|
import { UserRight } from '../../../../shared'
|
||||||
import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc'
|
import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc'
|
||||||
import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments'
|
import { isValidVideoCommentText } from '../../../helpers/custom-validators/video-comments'
|
||||||
|
@ -9,7 +9,7 @@ import { doesVideoExist } from '../../../helpers/middlewares'
|
||||||
import { AcceptResult, isLocalVideoCommentReplyAccepted, isLocalVideoThreadAccepted } from '../../../lib/moderation'
|
import { AcceptResult, isLocalVideoCommentReplyAccepted, isLocalVideoThreadAccepted } from '../../../lib/moderation'
|
||||||
import { Hooks } from '../../../lib/plugins/hooks'
|
import { Hooks } from '../../../lib/plugins/hooks'
|
||||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { MCommentOwnerVideoReply, MVideo, MVideoFullLight, MVideoId } from '../../../typings/models/video'
|
import { MCommentOwnerVideoReply, MVideo, MVideoFullLight, MVideoId } from '../../../types/models/video'
|
||||||
import { areValidationErrors } from '../utils'
|
import { areValidationErrors } from '../utils'
|
||||||
|
|
||||||
const listVideoCommentThreadsValidator = [
|
const listVideoCommentThreadsValidator = [
|
||||||
|
|
|
@ -27,8 +27,8 @@ import { authenticatePromiseIfNeeded } from '../../oauth'
|
||||||
import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||||
import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
|
import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
|
||||||
import { doesVideoChannelIdExist, doesVideoExist, doesVideoPlaylistExist, VideoPlaylistFetchType } from '../../../helpers/middlewares'
|
import { doesVideoChannelIdExist, doesVideoExist, doesVideoPlaylistExist, VideoPlaylistFetchType } from '../../../helpers/middlewares'
|
||||||
import { MVideoPlaylist } from '../../../typings/models/video/video-playlist'
|
import { MVideoPlaylist } from '../../../types/models/video/video-playlist'
|
||||||
import { MUserAccountId } from '@server/typings/models'
|
import { MUserAccountId } from '@server/types/models'
|
||||||
|
|
||||||
const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([
|
const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([
|
||||||
body('displayName')
|
body('displayName')
|
||||||
|
|
|
@ -47,7 +47,7 @@ import {
|
||||||
doesVideoExist,
|
doesVideoExist,
|
||||||
doesVideoFileOfVideoExist
|
doesVideoFileOfVideoExist
|
||||||
} from '../../../helpers/middlewares'
|
} from '../../../helpers/middlewares'
|
||||||
import { MVideoFullLight } from '@server/typings/models'
|
import { MVideoFullLight } from '@server/types/models'
|
||||||
import { getVideoWithAttributes } from '../../../helpers/video'
|
import { getVideoWithAttributes } from '../../../helpers/video'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { getSort, searchAttribute } from '../utils'
|
||||||
import { AccountBlock } from '../../../shared/models/blocklist'
|
import { AccountBlock } from '../../../shared/models/blocklist'
|
||||||
import { Op } from 'sequelize'
|
import { Op } from 'sequelize'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/typings/models'
|
import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models'
|
||||||
import { ActorModel } from '../activitypub/actor'
|
import { ActorModel } from '../activitypub/actor'
|
||||||
import { ServerModel } from '../server/server'
|
import { ServerModel } from '../server/server'
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
MAccountVideoRateAccountUrl,
|
MAccountVideoRateAccountUrl,
|
||||||
MAccountVideoRateAccountVideo,
|
MAccountVideoRateAccountVideo,
|
||||||
MAccountVideoRateFormattable
|
MAccountVideoRateFormattable
|
||||||
} from '@server/typings/models/video/video-rate'
|
} from '@server/types/models/video/video-rate'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Account rates per video.
|
Account rates per video.
|
||||||
|
|
|
@ -32,7 +32,7 @@ import { FindOptions, IncludeOptions, Op, Transaction, WhereOptions } from 'sequ
|
||||||
import { AccountBlocklistModel } from './account-blocklist'
|
import { AccountBlocklistModel } from './account-blocklist'
|
||||||
import { ServerBlocklistModel } from '../server/server-blocklist'
|
import { ServerBlocklistModel } from '../server/server-blocklist'
|
||||||
import { ActorFollowModel } from '../activitypub/actor-follow'
|
import { ActorFollowModel } from '../activitypub/actor-follow'
|
||||||
import { MAccountActor, MAccountAP, MAccountDefault, MAccountFormattable, MAccountSummaryFormattable, MAccount } from '../../typings/models'
|
import { MAccountActor, MAccountAP, MAccountDefault, MAccountFormattable, MAccountSummaryFormattable, MAccount } from '../../types/models'
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { ModelCache } from '@server/models/model-cache'
|
import { ModelCache } from '@server/models/model-cache'
|
||||||
import { VideoModel } from '../video/video'
|
import { VideoModel } from '../video/video'
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { UserModel } from './user'
|
||||||
import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
|
import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
|
||||||
import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
|
import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
|
||||||
import { clearCacheByUserId } from '../../lib/oauth-model'
|
import { clearCacheByUserId } from '../../lib/oauth-model'
|
||||||
import { MNotificationSettingFormattable } from '@server/typings/models'
|
import { MNotificationSettingFormattable } from '@server/types/models'
|
||||||
|
|
||||||
@Table({
|
@Table({
|
||||||
tableName: 'userNotificationSetting',
|
tableName: 'userNotificationSetting',
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { ActorModel } from '../activitypub/actor'
|
||||||
import { ActorFollowModel } from '../activitypub/actor-follow'
|
import { ActorFollowModel } from '../activitypub/actor-follow'
|
||||||
import { AvatarModel } from '../avatar/avatar'
|
import { AvatarModel } from '../avatar/avatar'
|
||||||
import { ServerModel } from '../server/server'
|
import { ServerModel } from '../server/server'
|
||||||
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/typings/models/user'
|
import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'
|
||||||
|
|
||||||
enum ScopeNames {
|
enum ScopeNames {
|
||||||
WITH_ALL = 'WITH_ALL'
|
WITH_ALL = 'WITH_ALL'
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue