Remove deprecated server code
This commit is contained in:
parent
11fd3a4618
commit
3842a527f6
|
@ -15,7 +15,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
|
|||
declare channel: VideoChannel
|
||||
declare account: Account
|
||||
|
||||
descriptionPath: string
|
||||
support: string
|
||||
tags: string[]
|
||||
downloadEnabled: boolean
|
||||
|
@ -39,7 +38,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
|
|||
constructor (hash: VideoDetailsServerModel, translations = {}) {
|
||||
super(hash, translations)
|
||||
|
||||
this.descriptionPath = hash.descriptionPath
|
||||
this.channel = new VideoChannel(hash.channel)
|
||||
this.account = new Account(hash.account)
|
||||
this.tags = hash.tags
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { VideoResolutionType } from '../videos/index.js'
|
||||
|
||||
export interface PlaybackMetricCreate {
|
||||
playerMode: 'p2p-media-loader' | 'webtorrent' | 'web-video' // FIXME: remove webtorrent player mode not used anymore in PeerTube v6
|
||||
playerMode: 'p2p-media-loader' | 'web-video'
|
||||
|
||||
resolution?: VideoResolutionType
|
||||
fps?: number
|
||||
|
|
|
@ -26,7 +26,6 @@ export interface VideosCommonQuery {
|
|||
|
||||
hasHLSFiles?: boolean
|
||||
|
||||
hasWebtorrentFiles?: boolean // TODO: remove in v7
|
||||
hasWebVideoFiles?: boolean
|
||||
|
||||
skipCount?: boolean
|
||||
|
|
|
@ -22,8 +22,6 @@ export interface PeerTubeProblemDocument extends PeerTubeProblemDocumentData {
|
|||
title: string
|
||||
|
||||
detail: string
|
||||
// FIXME: Compat PeerTube <= 3.2
|
||||
error: string
|
||||
|
||||
status: HttpStatusCodeType
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export interface VideoTranscodingCreate {
|
||||
transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
|
||||
transcodingType: 'hls' | 'web-video'
|
||||
|
||||
forceTranscoding?: boolean // Default false
|
||||
}
|
||||
|
|
|
@ -84,9 +84,6 @@ export interface VideoAdditionalAttributes {
|
|||
}
|
||||
|
||||
export interface VideoDetails extends Video {
|
||||
// TODO: remove, deprecated in 5.0
|
||||
descriptionPath: string
|
||||
|
||||
support: string
|
||||
channel: VideoChannel
|
||||
account: Account
|
||||
|
|
|
@ -82,18 +82,6 @@ export class VideosCommand extends AbstractCommand {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
getDescription (options: OverrideCommandOptions & {
|
||||
descriptionPath: string
|
||||
}) {
|
||||
return this.getRequestBody<{ description: string }>({
|
||||
...options,
|
||||
path: options.descriptionPath,
|
||||
|
||||
implicitToken: false,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
}
|
||||
|
||||
getFileMetadata (options: OverrideCommandOptions & {
|
||||
url: string
|
||||
}) {
|
||||
|
|
|
@ -376,7 +376,6 @@ describe('Test video passwords validator', function () {
|
|||
|
||||
expect(error.code).to.equal(serverCode)
|
||||
expect(error.detail).to.equal(message)
|
||||
expect(error.error).to.equal(message)
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.FORBIDDEN_403)
|
||||
}
|
||||
|
|
|
@ -457,7 +457,6 @@ describe('Test videos API validator', function () {
|
|||
expect(error.title).to.equal('Bad Request')
|
||||
|
||||
expect(error.detail).to.equal('Incorrect request parameters: language')
|
||||
expect(error.error).to.equal('Incorrect request parameters: language')
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.BAD_REQUEST_400)
|
||||
expect(error['invalid-params'].language).to.exist
|
||||
|
@ -725,7 +724,6 @@ describe('Test videos API validator', function () {
|
|||
expect(error.title).to.equal('Bad Request')
|
||||
|
||||
expect(error.detail).to.equal('Incorrect request parameters: licence')
|
||||
expect(error.error).to.equal('Incorrect request parameters: licence')
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.BAD_REQUEST_400)
|
||||
expect(error['invalid-params'].licence).to.exist
|
||||
|
@ -774,7 +772,6 @@ describe('Test videos API validator', function () {
|
|||
expect(error.title).to.equal('Bad Request')
|
||||
|
||||
expect(error.detail).to.equal('Incorrect request parameters: id')
|
||||
expect(error.error).to.equal('Incorrect request parameters: id')
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.BAD_REQUEST_400)
|
||||
expect(error['invalid-params'].id).to.exist
|
||||
|
@ -880,7 +877,6 @@ describe('Test videos API validator', function () {
|
|||
expect(error.title).to.equal('Bad Request')
|
||||
|
||||
expect(error.detail).to.equal('Incorrect request parameters: id')
|
||||
expect(error.error).to.equal('Incorrect request parameters: id')
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.BAD_REQUEST_400)
|
||||
expect(error['invalid-params'].id).to.exist
|
||||
|
|
|
@ -94,9 +94,6 @@ describe('Fast restream in live', function () {
|
|||
async function runTest (replay: boolean) {
|
||||
const { ffmpegCommand, liveVideoUUID } = await fastRestreamWrapper({ replay })
|
||||
|
||||
// TODO: remove, we try to debug a test timeout failure here
|
||||
console.log('Ensuring last live works')
|
||||
|
||||
await ensureLastLiveWorks(liveVideoUUID)
|
||||
|
||||
await stopFfmpeg(ffmpegCommand)
|
||||
|
|
|
@ -152,7 +152,6 @@ describe('Test follow constraints', function () {
|
|||
expect(error.code).to.equal(ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS)
|
||||
|
||||
expect(error.detail).to.equal('Cannot get this video regarding follow constraints')
|
||||
expect(error.error).to.equal(error.detail)
|
||||
|
||||
expect(error.status).to.equal(HttpStatusCode.FORBIDDEN_403)
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import { expect } from 'chai'
|
||||
import { wait } from '@peertube/peertube-core-utils'
|
||||
import { HttpStatusCode, OAuth2ErrorCode, PeerTubeProblemDocument } from '@peertube/peertube-models'
|
||||
import { SQLCommand } from '@tests/shared/sql-command.js'
|
||||
import {
|
||||
cleanupTests,
|
||||
createSingleServer,
|
||||
|
@ -11,6 +9,8 @@ import {
|
|||
PeerTubeServer,
|
||||
setAccessTokensToServers
|
||||
} from '@peertube/peertube-server-commands'
|
||||
import { SQLCommand } from '@tests/shared/sql-command.js'
|
||||
import { expect } from 'chai'
|
||||
|
||||
describe('Test oauth', function () {
|
||||
let server: PeerTubeServer
|
||||
|
@ -36,7 +36,7 @@ describe('Test oauth', function () {
|
|||
|
||||
function expectInvalidClient (body: PeerTubeProblemDocument) {
|
||||
expect(body.code).to.equal(OAuth2ErrorCode.INVALID_CLIENT)
|
||||
expect(body.error).to.contain('client is invalid')
|
||||
expect(body.detail).to.contain('client is invalid')
|
||||
expect(body.type.startsWith('https://')).to.be.true
|
||||
expect(body.type).to.contain(OAuth2ErrorCode.INVALID_CLIENT)
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ describe('Test oauth', function () {
|
|||
|
||||
function expectInvalidCredentials (body: PeerTubeProblemDocument) {
|
||||
expect(body.code).to.equal(OAuth2ErrorCode.INVALID_GRANT)
|
||||
expect(body.error).to.contain('credentials are invalid')
|
||||
expect(body.detail).to.contain('credentials are invalid')
|
||||
expect(body.type.startsWith('https://')).to.be.true
|
||||
expect(body.type).to.contain(OAuth2ErrorCode.INVALID_GRANT)
|
||||
}
|
||||
|
|
|
@ -68,15 +68,6 @@ describe('Test video description', function () {
|
|||
}
|
||||
})
|
||||
|
||||
it('Should fetch long description on each server', async function () {
|
||||
for (const server of servers) {
|
||||
const video = await server.videos.get({ id: videoUUID })
|
||||
|
||||
const { description } = await server.videos.getDescription({ descriptionPath: video.descriptionPath })
|
||||
expect(description).to.equal(longDescription)
|
||||
}
|
||||
})
|
||||
|
||||
it('Should update with a short description', async function () {
|
||||
const attributes = {
|
||||
description: 'short description'
|
||||
|
@ -91,9 +82,6 @@ describe('Test video description', function () {
|
|||
const video = await server.videos.get({ id: videoUUID })
|
||||
|
||||
expect(video.description).to.equal('short description')
|
||||
|
||||
const { description } = await server.videos.getDescription({ descriptionPath: video.descriptionPath })
|
||||
expect(description).to.equal('short description')
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -525,7 +525,7 @@ describe('Test plugin filter hooks', function () {
|
|||
expectedStatus: HttpStatusCode.FORBIDDEN_403
|
||||
})
|
||||
|
||||
expect((body as unknown as PeerTubeProblemDocument).error).to.equal('No jma 2')
|
||||
expect((body as unknown as PeerTubeProblemDocument).detail).to.equal('No jma 2')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import express from 'express'
|
||||
import validator from 'validator'
|
||||
import { HttpStatusCode, UserRight } from '@peertube/peertube-models'
|
||||
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
|
||||
import { federateVideoIfNeeded } from '@server/lib/activitypub/videos/index.js'
|
||||
import { updateM3U8AndShaPlaylist } from '@server/lib/hls.js'
|
||||
import { removeAllWebVideoFiles, removeHLSFile, removeHLSPlaylist, removeWebVideoFile } from '@server/lib/video-file.js'
|
||||
import { VideoFileModel } from '@server/models/video/video-file.js'
|
||||
import { HttpStatusCode, UserRight } from '@peertube/peertube-models'
|
||||
import express from 'express'
|
||||
import validator from 'validator'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
authenticate,
|
||||
|
@ -40,15 +40,13 @@ filesRouter.delete('/:id/hls/:videoFileId',
|
|||
asyncMiddleware(removeHLSFileController)
|
||||
)
|
||||
|
||||
filesRouter.delete(
|
||||
[ '/:id/webtorrent', '/:id/web-videos' ], // TODO: remove webtorrent in V7
|
||||
filesRouter.delete('/:id/web-videos',
|
||||
authenticate,
|
||||
ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
|
||||
asyncMiddleware(videoFilesDeleteWebVideoValidator),
|
||||
asyncMiddleware(removeAllWebVideoFilesController)
|
||||
)
|
||||
filesRouter.delete(
|
||||
[ '/:id/webtorrent/:videoFileId', '/:id/web-videos/:videoFileId' ], // TODO: remove webtorrent in V7
|
||||
filesRouter.delete('/:id/web-videos/:videoFileId',
|
||||
authenticate,
|
||||
ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
|
||||
asyncMiddleware(videoFilesDeleteWebVideoFileValidator),
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import express from 'express'
|
||||
import { HttpStatusCode } from '@peertube/peertube-models'
|
||||
import { pickCommonVideoQuery } from '@server/helpers/query.js'
|
||||
import { doJSONRequest } from '@server/helpers/requests.js'
|
||||
import { openapiOperationDoc } from '@server/middlewares/doc.js'
|
||||
import { getServerActor } from '@server/models/application/application.js'
|
||||
import { MVideoAccountLight } from '@server/types/models/index.js'
|
||||
import express from 'express'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger.js'
|
||||
import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils.js'
|
||||
import { logger } from '../../../helpers/logger.js'
|
||||
import { getFormattedObjects } from '../../../helpers/utils.js'
|
||||
import { REMOTE_SCHEME, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers/constants.js'
|
||||
import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers/constants.js'
|
||||
import { sequelizeTypescript } from '../../../initializers/database.js'
|
||||
import { JobQueue } from '../../../lib/job-queue/index.js'
|
||||
import { Hooks } from '../../../lib/plugins/hooks.js'
|
||||
|
@ -25,7 +23,6 @@ import {
|
|||
setDefaultPagination,
|
||||
setDefaultVideosSort,
|
||||
videosCustomGetValidator,
|
||||
videosGetValidator,
|
||||
videosRemoveValidator,
|
||||
videosSortValidator
|
||||
} from '../../../middlewares/index.js'
|
||||
|
@ -33,6 +30,7 @@ import { guessAdditionalAttributesFromQuery } from '../../../models/video/format
|
|||
import { VideoModel } from '../../../models/video/video.js'
|
||||
import { blacklistRouter } from './blacklist.js'
|
||||
import { videoCaptionsRouter } from './captions.js'
|
||||
import { videoChaptersRouter } from './chapters.js'
|
||||
import { videoCommentRouter } from './comment.js'
|
||||
import { filesRouter } from './files.js'
|
||||
import { videoImportsRouter } from './import.js'
|
||||
|
@ -49,7 +47,6 @@ import { transcodingRouter } from './transcoding.js'
|
|||
import { updateRouter } from './update.js'
|
||||
import { uploadRouter } from './upload.js'
|
||||
import { viewRouter } from './view.js'
|
||||
import { videoChaptersRouter } from './chapters.js'
|
||||
|
||||
const auditLogger = auditLoggerFactory('videos')
|
||||
const videosRouter = express.Router()
|
||||
|
@ -104,13 +101,6 @@ videosRouter.get('/',
|
|||
asyncMiddleware(listVideos)
|
||||
)
|
||||
|
||||
// TODO: remove, deprecated in 5.0 now we send the complete description in VideoDetails
|
||||
videosRouter.get('/:id/description',
|
||||
openapiOperationDoc({ operationId: 'getVideoDesc' }),
|
||||
asyncMiddleware(videosGetValidator),
|
||||
asyncMiddleware(getVideoDescription)
|
||||
)
|
||||
|
||||
videosRouter.get('/:id',
|
||||
openapiOperationDoc({ operationId: 'getVideo' }),
|
||||
optionalAuthenticate,
|
||||
|
@ -165,16 +155,6 @@ async function getVideo (req: express.Request, res: express.Response) {
|
|||
return res.json(video.toFormattedDetailsJSON())
|
||||
}
|
||||
|
||||
async function getVideoDescription (req: express.Request, res: express.Response) {
|
||||
const videoInstance = res.locals.videoAll
|
||||
|
||||
const description = videoInstance.isOwned()
|
||||
? videoInstance.description
|
||||
: await fetchRemoteVideoDescription(videoInstance)
|
||||
|
||||
return res.json({ description })
|
||||
}
|
||||
|
||||
async function listVideos (req: express.Request, res: express.Response) {
|
||||
const serverActor = await getServerActor()
|
||||
|
||||
|
@ -218,15 +198,3 @@ async function removeVideo (req: express.Request, res: express.Response) {
|
|||
.status(HttpStatusCode.NO_CONTENT_204)
|
||||
.end()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// FIXME: Should not exist, we rely on specific API
|
||||
async function fetchRemoteVideoDescription (video: MVideoAccountLight) {
|
||||
const host = video.VideoChannel.Account.Actor.Server.host
|
||||
const path = video.getDescriptionAPIPath()
|
||||
const url = REMOTE_SCHEME.HTTP + '://' + host + path
|
||||
|
||||
const { body } = await doJSONRequest<any>(url)
|
||||
return body.description || ''
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import cors from 'cors'
|
||||
import express from 'express'
|
||||
import { readFile } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import { HttpStatusCode } from '@peertube/peertube-models'
|
||||
import { injectQueryToPlaylistUrls } from '@server/lib/hls.js'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
|
@ -10,9 +7,12 @@ import {
|
|||
handleStaticError,
|
||||
optionalAuthenticate
|
||||
} from '@server/middlewares/index.js'
|
||||
import { HttpStatusCode } from '@peertube/peertube-models'
|
||||
import cors from 'cors'
|
||||
import express from 'express'
|
||||
import { readFile } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import { CONFIG } from '../initializers/config.js'
|
||||
import { DIRECTORIES, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers/constants.js'
|
||||
import { DIRECTORIES, STATIC_PATHS } from '../initializers/constants.js'
|
||||
import { buildReinjectVideoFileTokenQuery, doReinjectVideoFileToken } from './shared/m3u8-playlist.js'
|
||||
|
||||
const staticRouter = express.Router()
|
||||
|
@ -72,14 +72,6 @@ staticRouter.use(
|
|||
handleStaticError
|
||||
)
|
||||
|
||||
// FIXME: deprecated in v6, to remove
|
||||
const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR
|
||||
staticRouter.use(
|
||||
STATIC_PATHS.THUMBNAILS,
|
||||
express.static(thumbnailsPhysicalPath, { maxAge: STATIC_MAX_AGE.SERVER, fallthrough: false }),
|
||||
handleStaticError
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
|
|
|
@ -233,10 +233,7 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string
|
|||
},
|
||||
|
||||
lemmy: 'https://join-lemmy.org/ns#',
|
||||
postingRestrictedToMods: 'lemmy:postingRestrictedToMods',
|
||||
|
||||
// TODO: remove in a few versions, introduced in 4.2
|
||||
icons: 'as:icon'
|
||||
postingRestrictedToMods: 'lemmy:postingRestrictedToMods'
|
||||
}),
|
||||
|
||||
WatchAction: buildContext({
|
||||
|
|
|
@ -20,7 +20,7 @@ function isPlaylistRedundancyUrlValid (url: any) {
|
|||
isActivityPubUrlValid(url.href)
|
||||
}
|
||||
|
||||
// TODO: compat with < 6.1, use isRemoteVideoUrlValid instead in 7.0
|
||||
// TODO: compat with < 6.1, use isRemoteVideoUrlValid instead in 8.0
|
||||
function isRedundancyUrlVideoValid (url: any) {
|
||||
const size = url.size || url['_:size']
|
||||
const fps = url.fps || url['_fps']
|
||||
|
|
|
@ -7,7 +7,7 @@ import { isActivityPubUrlValid } from './misc.js'
|
|||
export function isPlaylistObjectValid (object: PlaylistObject) {
|
||||
if (!object || object.type !== 'Playlist') return false
|
||||
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
if (!object.uuid && object['identifier']) object.uuid = object['identifier']
|
||||
|
||||
return validator.default.isInt(object.totalItems + '') &&
|
||||
|
|
|
@ -47,7 +47,7 @@ export function sanitizeAndCheckVideoTorrentObject (video: VideoObject) {
|
|||
if (!setValidStoryboard(video)) return fail('preview (storyboard)')
|
||||
if (!setValidLicence(video)) return fail('licence')
|
||||
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
if (!video.uuid && video['identifier']) video.uuid = video['identifier']
|
||||
|
||||
// Default attributes
|
||||
|
|
|
@ -7,7 +7,7 @@ import { isActivityPubVideoDurationValid, isObjectValid } from './misc.js'
|
|||
function isWatchActionObjectValid (action: WatchActionObject) {
|
||||
if (!action || action.type !== 'WatchAction') return false
|
||||
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
if (!action.uuid && action['identifier']) action.uuid = action['identifier']
|
||||
|
||||
if (action['_:actionStatus'] && !action.actionStatus) action.actionStatus = action['_:actionStatus']
|
||||
|
@ -43,7 +43,7 @@ function isLocationValid (location: any) {
|
|||
|
||||
function areWatchSectionsValid (sections: WatchActionObject['watchSections']) {
|
||||
return Array.isArray(sections) && sections.every(s => {
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
if (s['_:endTimestamp'] && !s.endTimestamp) s.endTimestamp = s['_:endTimestamp']
|
||||
|
||||
return isVideoTimeValid(s.startTimestamp) && isVideoTimeValid(s.endTimestamp)
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
function isValidPlayerMode (value: any) {
|
||||
// TODO: remove webtorrent in v7
|
||||
return value === 'webtorrent' || value === 'web-video' || value === 'p2p-media-loader'
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isValidPlayerMode
|
||||
export function isValidPlayerMode (value: any) {
|
||||
return value === 'web-video' || value === 'p2p-media-loader'
|
||||
}
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
import { exists } from './misc.js'
|
||||
|
||||
function isValidCreateTranscodingType (value: any) {
|
||||
return exists(value) &&
|
||||
(value === 'hls' || value === 'webtorrent' || value === 'web-video') // TODO: remove webtorrent in v7
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isValidCreateTranscodingType
|
||||
export function isValidCreateTranscodingType (value: any) {
|
||||
return exists(value) && (value === 'hls' || value === 'web-video')
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ export async function compactJSONLDAndCheckRSA2017Signature (fromActor: MActor,
|
|||
return false
|
||||
}
|
||||
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
let safe = true
|
||||
if (
|
||||
(compacted.type === 'Create' && (compacted?.object?.type === 'WatchAction' || compacted?.object?.type === 'CacheFile')) ||
|
||||
|
|
|
@ -23,7 +23,6 @@ function pickCommonVideoQuery (query: VideosCommonQueryAfterSanitize) {
|
|||
'include',
|
||||
'skipCount',
|
||||
'hasHLSFiles',
|
||||
'hasWebtorrentFiles', // TODO: Remove in v7
|
||||
'hasWebVideoFiles',
|
||||
'search',
|
||||
'excludeAlreadyWatched',
|
||||
|
|
|
@ -845,9 +845,6 @@ export const USER_EXPORT_FILE_PREFIX = 'user-export-'
|
|||
|
||||
// Express static paths (router)
|
||||
export const STATIC_PATHS = {
|
||||
// TODO: deprecated in v6, to remove
|
||||
THUMBNAILS: '/static/thumbnails/',
|
||||
|
||||
// Need to keep this legacy path for previously generated torrents
|
||||
LEGACY_WEB_VIDEOS: '/static/webseed/',
|
||||
WEB_VIDEOS: '/static/web-videos/',
|
||||
|
|
|
@ -66,7 +66,7 @@ function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject
|
|||
}
|
||||
|
||||
const url = cacheFileObject.url
|
||||
const urlFPS = exists(url.fps) // TODO: compat with < 6.1, remove in 7.0
|
||||
const urlFPS = exists(url.fps) // TODO: compat with < 6.1, remove in 8.0
|
||||
? url.fps
|
||||
: url['_:fps']
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ function getViewerResultCounter (activity: ActivityView) {
|
|||
return counter
|
||||
}
|
||||
|
||||
// TODO: compat with < 6.1, remove in 7.0
|
||||
// TODO: compat with < 6.1, remove in 8.0
|
||||
function getExpires (activity: ActivityView) {
|
||||
return activity.expires || activity['expiration'] as string
|
||||
}
|
||||
|
|
|
@ -142,10 +142,6 @@ function buildVideosHelpers () {
|
|||
}))
|
||||
|
||||
return {
|
||||
webtorrent: { // TODO: remove in v7
|
||||
videoFiles: webVideoFiles
|
||||
},
|
||||
|
||||
webVideo: {
|
||||
videoFiles: webVideoFiles
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@ export function createOptimizeOrMergeAudioJobs (options: {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
export function createTranscodingJobs (options: {
|
||||
transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
|
||||
transcodingType: 'hls' | 'web-video'
|
||||
video: MVideoFullLight
|
||||
resolutions: number[]
|
||||
isNewVideo: boolean
|
||||
|
|
|
@ -137,7 +137,7 @@ export abstract class AbstractJobBuilder <P> {
|
|||
}
|
||||
|
||||
async createTranscodingJobs (options: {
|
||||
transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
|
||||
transcodingType: 'hls' | 'web-video'
|
||||
video: MVideoFullLight
|
||||
resolutions: number[]
|
||||
isNewVideo: boolean
|
||||
|
@ -164,7 +164,7 @@ export abstract class AbstractJobBuilder <P> {
|
|||
return this.buildHLSJobPayload({ video, resolution, fps, isNewVideo, separatedAudio })
|
||||
}
|
||||
|
||||
if (transcodingType === 'webtorrent' || transcodingType === 'web-video') {
|
||||
if (transcodingType === 'web-video') {
|
||||
return this.buildWebVideoJobPayload({ video, resolution, fps, isNewVideo })
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ export function executeIfActivityPub (req: Request, res: Response, next: NextFun
|
|||
|
||||
async function checkHttpSignature (req: Request, res: Response) {
|
||||
return wrapWithSpanAndContext('peertube.activitypub.checkHTTPSignature', async () => {
|
||||
// FIXME: compatibility with http-signature < v1.3
|
||||
// Compatibility with http-signature < v1.3
|
||||
const sig = req.headers[HTTP_SIGNATURE.HEADER_NAME] as string
|
||||
if (sig && sig.startsWith('Signature ') === true) req.headers[HTTP_SIGNATURE.HEADER_NAME] = sig.replace(/^Signature /, '')
|
||||
|
||||
|
|
|
@ -11,10 +11,7 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e
|
|||
...data,
|
||||
|
||||
docs: res.locals.docUrl,
|
||||
code: type,
|
||||
|
||||
// For <= 3.2 compatibility
|
||||
error: message
|
||||
code: type
|
||||
})
|
||||
|
||||
const json = new ProblemDocument({
|
||||
|
|
|
@ -472,10 +472,6 @@ export const commonVideosFiltersValidator = [
|
|||
.optional()
|
||||
.customSanitizer(toBooleanOrNull)
|
||||
.custom(isBooleanValid).withMessage('Should have a valid hasHLSFiles boolean'),
|
||||
query('hasWebtorrentFiles') // TODO: remove in v7
|
||||
.optional()
|
||||
.customSanitizer(toBooleanOrNull)
|
||||
.custom(isBooleanValid).withMessage('Should have a valid hasWebtorrentFiles boolean'),
|
||||
query('hasWebVideoFiles')
|
||||
.optional()
|
||||
.customSanitizer(toBooleanOrNull)
|
||||
|
|
|
@ -157,7 +157,6 @@ export function videoModelToFormattedDetailsJSON (video: MVideoFormattableDetail
|
|||
...videoJSON,
|
||||
|
||||
support: video.support,
|
||||
descriptionPath: video.getDescriptionAPIPath(),
|
||||
channel: video.VideoChannel.toFormattedJSON(),
|
||||
account: video.VideoChannel.Account.toFormattedJSON(),
|
||||
tags,
|
||||
|
|
|
@ -54,7 +54,6 @@ export type BuildVideosListQueryOptions = {
|
|||
hasHLSFiles?: boolean
|
||||
|
||||
hasWebVideoFiles?: boolean
|
||||
hasWebtorrentFiles?: boolean // TODO: Remove in v7
|
||||
|
||||
accountId?: number
|
||||
videoChannelId?: number
|
||||
|
@ -188,9 +187,7 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery {
|
|||
this.whereFileExists()
|
||||
}
|
||||
|
||||
if (exists(options.hasWebtorrentFiles)) {
|
||||
this.whereWebVideoFileExists(options.hasWebtorrentFiles)
|
||||
} else if (exists(options.hasWebVideoFiles)) {
|
||||
if (exists(options.hasWebVideoFiles)) {
|
||||
this.whereWebVideoFileExists(options.hasWebVideoFiles)
|
||||
}
|
||||
|
||||
|
|
|
@ -1154,7 +1154,6 @@ export class VideoModel extends SequelizeModel<VideoModel> {
|
|||
|
||||
hasFiles?: boolean // default false
|
||||
|
||||
hasWebtorrentFiles?: boolean // TODO: remove in v7
|
||||
hasWebVideoFiles?: boolean
|
||||
|
||||
hasHLSFiles?: boolean
|
||||
|
@ -1223,7 +1222,6 @@ export class VideoModel extends SequelizeModel<VideoModel> {
|
|||
'user',
|
||||
'historyOfUser',
|
||||
'hasHLSFiles',
|
||||
'hasWebtorrentFiles',
|
||||
'hasWebVideoFiles',
|
||||
'search',
|
||||
'excludeAlreadyWatched'
|
||||
|
@ -1258,7 +1256,6 @@ export class VideoModel extends SequelizeModel<VideoModel> {
|
|||
|
||||
user?: MUserAccountId
|
||||
|
||||
hasWebtorrentFiles?: boolean // TODO: remove in v7
|
||||
hasWebVideoFiles?: boolean
|
||||
|
||||
hasHLSFiles?: boolean
|
||||
|
@ -1311,7 +1308,6 @@ export class VideoModel extends SequelizeModel<VideoModel> {
|
|||
'durationMin',
|
||||
'durationMax',
|
||||
'hasHLSFiles',
|
||||
'hasWebtorrentFiles',
|
||||
'hasWebVideoFiles',
|
||||
'uuids',
|
||||
'search',
|
||||
|
|
|
@ -42,16 +42,6 @@ export type PeerTubeHelpers = {
|
|||
ffprobe: (path: string) => Promise<any>
|
||||
|
||||
getFiles: (id: number | string) => Promise<{
|
||||
webtorrent: { // TODO: remove in v7
|
||||
videoFiles: {
|
||||
path: string // Could be null if using remote storage
|
||||
url: string
|
||||
resolution: number
|
||||
size: number
|
||||
fps: number
|
||||
}[]
|
||||
}
|
||||
|
||||
webVideo: {
|
||||
videoFiles: {
|
||||
path: string // Could be null if using remote storage
|
||||
|
|
Loading…
Reference in New Issue