Don't save other attributes when set as refreshed
This commit is contained in:
parent
b044cb188d
commit
c24822a8fd
|
@ -7,7 +7,15 @@ import { VideoModel } from '../../../models/video/video'
|
||||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
|
import { VideoPlaylistModel } from '../../../models/video/video-playlist'
|
||||||
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
import { APProcessorOptions } from '../../../types/activitypub-processor.model'
|
||||||
import { MAccountActor, MActor, MActorSignature, MChannelActor, MCommentOwnerVideo } from '../../../types/models'
|
import {
|
||||||
|
MAccountActor,
|
||||||
|
MActor,
|
||||||
|
MActorFull,
|
||||||
|
MActorSignature,
|
||||||
|
MChannelAccountActor,
|
||||||
|
MChannelActor,
|
||||||
|
MCommentOwnerVideo
|
||||||
|
} from '../../../types/models'
|
||||||
import { markCommentAsDeleted } from '../../video-comment'
|
import { markCommentAsDeleted } from '../../video-comment'
|
||||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||||
|
|
||||||
|
@ -30,7 +38,8 @@ async function processDeleteActivity (options: APProcessorOptions<ActivityDelete
|
||||||
} else if (byActorFull.type === 'Group') {
|
} else if (byActorFull.type === 'Group') {
|
||||||
if (!byActorFull.VideoChannel) throw new Error('Actor ' + byActorFull.url + ' is a group but we cannot find it in database.')
|
if (!byActorFull.VideoChannel) throw new Error('Actor ' + byActorFull.url + ' is a group but we cannot find it in database.')
|
||||||
|
|
||||||
const channelToDelete = Object.assign({}, byActorFull.VideoChannel, { Actor: byActorFull })
|
const channelToDelete = byActorFull.VideoChannel as MChannelAccountActor & { Actor: MActorFull }
|
||||||
|
channelToDelete.Actor = byActorFull
|
||||||
return retryTransactionWrapper(processDeleteVideoChannel, channelToDelete)
|
return retryTransactionWrapper(processDeleteVideoChannel, channelToDelete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2027,9 +2027,11 @@ export class VideoModel extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
setAsRefreshed () {
|
setAsRefreshed () {
|
||||||
this.changed('updatedAt', true)
|
const options = {
|
||||||
|
where: { id: this.id }
|
||||||
|
}
|
||||||
|
|
||||||
return this.save()
|
return VideoModel.update({ updatedAt: new Date() }, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
requiresAuth () {
|
requiresAuth () {
|
||||||
|
|
Loading…
Reference in New Issue