return createRequest(options)
}
-function removeVideoToFriends (videoParams: RemoteVideoRemoveData, transaction: Sequelize.Transaction) {
+function removeVideoToFriends (videoParams: RemoteVideoRemoveData, transaction?: Sequelize.Transaction) {
const options = {
type: ENDPOINT_ACTIONS.REMOVE_VIDEO,
endpoint: REQUEST_ENDPOINTS.VIDEOS,
return createRequest(options)
}
-function removeVideoAuthorToFriends (authorData: RemoteVideoAuthorRemoveData, transaction: Sequelize.Transaction) {
+function removeVideoAuthorToFriends (authorData: RemoteVideoAuthorRemoveData, transaction?: Sequelize.Transaction) {
const options = {
type: ENDPOINT_ACTIONS.REMOVE_AUTHOR,
endpoint: REQUEST_ENDPOINTS.VIDEOS,
return createRequest(options)
}
-function removeVideoChannelToFriends (videoChannelParams: RemoteVideoChannelRemoveData, transaction: Sequelize.Transaction) {
+function removeVideoChannelToFriends (videoChannelParams: RemoteVideoChannelRemoveData, transaction?: Sequelize.Transaction) {
const options = {
type: ENDPOINT_ACTIONS.REMOVE_CHANNEL,
endpoint: REQUEST_ENDPOINTS.VIDEOS,
})
}
-function afterDestroy (author: AuthorInstance, options: { transaction: Sequelize.Transaction }) {
+function afterDestroy (author: AuthorInstance) {
if (author.isOwned()) {
const removeVideoAuthorToFriendsParams = {
uuid: author.uuid
}
- return removeVideoAuthorToFriends(removeVideoAuthorToFriendsParams, options.transaction)
+ return removeVideoAuthorToFriends(removeVideoAuthorToFriendsParams)
}
return undefined
})
}
-function afterDestroy (videoChannel: VideoChannelInstance, options: { transaction: Sequelize.Transaction }) {
+function afterDestroy (videoChannel: VideoChannelInstance) {
if (videoChannel.isOwned()) {
const removeVideoChannelToFriendsParams = {
uuid: videoChannel.uuid
}
- return removeVideoChannelToFriends(removeVideoChannelToFriendsParams, options.transaction)
+ return removeVideoChannelToFriends(removeVideoChannelToFriendsParams)
}
return undefined
})
}
-function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.Transaction }) {
+function afterDestroy (video: VideoInstance) {
const tasks = []
tasks.push(
tasks.push(
video.removePreview(),
- removeVideoToFriends(removeVideoToFriendsParams, options.transaction)
+ removeVideoToFriends(removeVideoToFriendsParams)
)
// Remove physical files and torrents