"reflect-metadata": "^0.1.12",
"request": "^2.81.0",
"scripty": "^1.5.0",
- "sequelize": "4.41.2",
- "sequelize-typescript": "0.6.6",
+ "sequelize": "4.42.0",
+ "sequelize-typescript": "0.6.7",
"sharp": "^0.21.0",
"sitemap": "^2.1.0",
"socket.io": "^2.2.0",
for (const rawVideo of rawVideos) {
const videoChannel = await utils.db.VideoChannel.findOne({ where: { authorId: rawVideo.authorId } })
- const video = await utils.db.Video.findById(rawVideo.id)
+ const video = await utils.db.Video.findByPk(rawVideo.id)
video.channelId = videoChannel.id
await video.save()
}
import { VideoChannelModel } from '../video/video-channel'
import { VideoCommentModel } from '../video/video-comment'
import { UserModel } from './user'
-import * as Bluebird from '../../helpers/custom-validators/accounts'
import { CONFIG } from '../../initializers'
@DefaultScope({
}
static load (id: number, transaction?: Sequelize.Transaction) {
- return AccountModel.findById(id, { transaction })
+ return AccountModel.findByPk(id, { transaction })
}
static loadByUUID (uuid: string) {
}
static loadById (id: number) {
- return UserModel.findById(id)
+ return UserModel.findByPk(id)
}
static loadByUsername (username: string) {
VideoChannel: VideoChannelModel
static load (id: number) {
- return ActorModel.unscoped().findById(id)
+ return ActorModel.unscoped().findByPk(id)
}
static loadAccountActorByVideoId (videoId: number, transaction: Sequelize.Transaction) {
}
static load (id: number) {
- return VideoChangeOwnershipModel.scope(ScopeNames.FULL).findById(id)
+ return VideoChangeOwnershipModel.scope(ScopeNames.FULL).findByPk(id)
}
toFormattedJSON (): VideoChangeOwnership {
static loadByIdAndPopulateAccount (id: number) {
return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
- .findById(id)
+ .findByPk(id)
}
static loadByIdAndAccount (id: number, accountId: number) {
static loadAndPopulateAccount (id: number) {
return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
- .findById(id)
+ .findByPk(id)
}
static loadByUUIDAndPopulateAccount (uuid: string) {
return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT, ScopeNames.WITH_VIDEOS ])
- .findById(id, options)
+ .findByPk(id, options)
}
toFormattedJSON (): VideoChannel {
]
}
- return VideoFileModel.findById(id, options)
+ return VideoFileModel.findByPk(id, options)
}
static async getStats () {
}
static loadAndPopulateVideo (id: number) {
- return VideoImportModel.findById(id)
+ return VideoImportModel.findByPk(id)
}
static listUserVideoImportsForApi (userId: number, start: number, count: number, sort: string) {
]
}
- return VideoStreamingPlaylistModel.findById(id, options)
+ return VideoStreamingPlaylistModel.findByPk(id, options)
}
static getHlsPlaylistFilename (resolution: number) {
static loadWithFiles (id: number, t?: Sequelize.Transaction, logging?: boolean) {
return VideoModel.scope([ ScopeNames.WITH_FILES, ScopeNames.WITH_STREAMING_PLAYLISTS ])
- .findById(id, { transaction: t, logging })
+ .findByPk(id, { transaction: t, logging })
}
static loadByUUIDWithFile (uuid: string) {
})
})
- describe('When checking if subscriptions exist', async function () {
+ describe('When checking if subscriptions exist', function () {
const existPath = path + '/exist'
it('Should fail with a non authenticated user', async function () {
})
})
- describe('When blocking/unblocking user', async function () {
+ describe('When blocking/unblocking user', function () {
+
it('Should send the notification email when blocking a user', async function () {
this.timeout(10000)
expect(res.body.data[0].name).to.equal('server3')
})
- describe('Should propagate data on a new following', async function () {
+ describe('Should propagate data on a new following', function () {
let video4: Video
before(async function () {
range-parser "~1.2.0"
statuses "~1.4.0"
-sequelize-typescript@0.6.6:
- version "0.6.6"
- resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.6.tgz#926037b542dae9f4eff20609d095cc5e3a3640f3"
- integrity sha512-WGJTaNuHyYwUM8itxZvMVLeNEb7xSjisbVN1Q5rxLaIf2w67Xaf1GX6Jb+9840bjcNPvMsKgC2aR88zmw7UlcQ==
+sequelize-typescript@0.6.7:
+ version "0.6.7"
+ resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.7.tgz#372be979cbae060c554fdbaf2c2d8c93a0283303"
+ integrity sha512-ae21Gq9VOVXlIjnh2vLdL42Kev6r4LC82xOQ2fXo0lHzQvjFeH8/GaWUlpvYv57AOgc+ZnElbYFbSLKdT9ue0w==
dependencies:
"@types/bluebird" "3.5.18"
"@types/node" "6.0.41"
es6-shim "0.35.3"
glob "7.1.2"
-sequelize@4.41.2:
- version "4.41.2"
- resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.41.2.tgz#bb9ba30d72e9eeb883c9861cd0e2cac672010883"
- integrity sha512-8vPf2R0o9iEmtzkqNzwFdblO+0Mu+RNxOdLeYGGqWGlp3cushLpQucAeSGPQgf2hQVZP5yOCM1ouZKTQ5FTlvA==
+sequelize@4.42.0:
+ version "4.42.0"
+ resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.42.0.tgz#439467ba7bfe7d5afcc56d62b3e091860fbf18f3"
+ integrity sha512-qxAYnX4rcv7PbNtEidb56REpxNJCdbN0qyk1jb3+e6sE7OrmS0nYMU+MFVbNTJtZfSpOEEL1TX0TkMw+wzZBxg==
dependencies:
bluebird "^3.5.0"
cls-bluebird "^2.1.0"