mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Merge branch 'release/v1.3.0' into develop
This commit is contained in:
@@ -26,6 +26,7 @@ import { sequelizeTypescript } from '../../../initializers/database'
|
||||
import { createVideoMiniatureFromExisting } from '../../../lib/thumbnail'
|
||||
import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
|
||||
import { ThumbnailModel } from '../../../models/video/thumbnail'
|
||||
import { UserModel } from '../../../models/account/user'
|
||||
|
||||
const auditLogger = auditLoggerFactory('video-imports')
|
||||
const videoImportsRouter = express.Router()
|
||||
@@ -107,7 +108,8 @@ async function addTorrentImport (req: express.Request, res: express.Response, to
|
||||
previewModel,
|
||||
videoChannel: res.locals.videoChannel,
|
||||
tags,
|
||||
videoImportAttributes
|
||||
videoImportAttributes,
|
||||
user
|
||||
})
|
||||
|
||||
// Create job to import the video
|
||||
@@ -151,12 +153,13 @@ async function addYoutubeDLImport (req: express.Request, res: express.Response)
|
||||
userId: user.id
|
||||
}
|
||||
const videoImport = await insertIntoDB({
|
||||
video: video,
|
||||
video,
|
||||
thumbnailModel,
|
||||
previewModel,
|
||||
videoChannel: res.locals.videoChannel,
|
||||
tags,
|
||||
videoImportAttributes
|
||||
videoImportAttributes,
|
||||
user
|
||||
})
|
||||
|
||||
// Create job to import the video
|
||||
@@ -227,9 +230,10 @@ function insertIntoDB (parameters: {
|
||||
previewModel: ThumbnailModel,
|
||||
videoChannel: VideoChannelModel,
|
||||
tags: string[],
|
||||
videoImportAttributes: Partial<VideoImportModel>
|
||||
videoImportAttributes: Partial<VideoImportModel>,
|
||||
user: UserModel
|
||||
}): Bluebird<VideoImportModel> {
|
||||
let { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes } = parameters
|
||||
const { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes, user } = parameters
|
||||
|
||||
return sequelizeTypescript.transaction(async t => {
|
||||
const sequelizeOptions = { transaction: t }
|
||||
@@ -241,7 +245,7 @@ function insertIntoDB (parameters: {
|
||||
if (thumbnailModel) await videoCreated.addAndSaveThumbnail(thumbnailModel, t)
|
||||
if (previewModel) await videoCreated.addAndSaveThumbnail(previewModel, t)
|
||||
|
||||
await autoBlacklistVideoIfNeeded(video, videoChannel.Account.User, t)
|
||||
await autoBlacklistVideoIfNeeded(video, user, t)
|
||||
|
||||
// Set tags to the video
|
||||
if (tags) {
|
||||
|
||||
@@ -156,6 +156,19 @@ staticRouter.use('/.well-known/change-password',
|
||||
}
|
||||
)
|
||||
|
||||
staticRouter.use('/.well-known/host-meta',
|
||||
(_, res: express.Response) => {
|
||||
res.type('application/xml')
|
||||
|
||||
const xml = '<?xml version="1.0" encoding="UTF-8"?>\n' +
|
||||
'<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">\n' +
|
||||
` <Link rel="lrdd" type="application/xrd+xml" template="${WEBSERVER.URL}/.well-known/webfinger?resource={uri}"/>\n` +
|
||||
'</XRD>'
|
||||
|
||||
res.send(xml).end()
|
||||
}
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user