diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-12 13:44:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-12 13:44:58 +0200 |
commit | c24822a8fdbc0647aa983fe7d784864ec3b9b854 (patch) | |
tree | 31634264504b4df282377ab6dc25a4f60a65828c /server | |
parent | b044cb188d1aac57fbb589e1627e400439cda10f (diff) | |
download | PeerTube-c24822a8fdbc0647aa983fe7d784864ec3b9b854.tar.gz PeerTube-c24822a8fdbc0647aa983fe7d784864ec3b9b854.tar.zst PeerTube-c24822a8fdbc0647aa983fe7d784864ec3b9b854.zip |
Don't save other attributes when set as refreshed
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/activitypub/process/process-delete.ts | 13 | ||||
-rw-r--r-- | server/models/video/video.ts | 6 |
2 files changed, 15 insertions, 4 deletions
diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index 070ee0f1d..88a968318 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts | |||
@@ -7,7 +7,15 @@ import { VideoModel } from '../../../models/video/video' | |||
7 | import { VideoCommentModel } from '../../../models/video/video-comment' | 7 | import { VideoCommentModel } from '../../../models/video/video-comment' |
8 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 8 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
9 | import { APProcessorOptions } from '../../../types/activitypub-processor.model' | 9 | import { APProcessorOptions } from '../../../types/activitypub-processor.model' |
10 | import { MAccountActor, MActor, MActorSignature, MChannelActor, MCommentOwnerVideo } from '../../../types/models' | 10 | import { |
11 | MAccountActor, | ||
12 | MActor, | ||
13 | MActorFull, | ||
14 | MActorSignature, | ||
15 | MChannelAccountActor, | ||
16 | MChannelActor, | ||
17 | MCommentOwnerVideo | ||
18 | } from '../../../types/models' | ||
11 | import { markCommentAsDeleted } from '../../video-comment' | 19 | import { markCommentAsDeleted } from '../../video-comment' |
12 | import { forwardVideoRelatedActivity } from '../send/utils' | 20 | import { forwardVideoRelatedActivity } from '../send/utils' |
13 | 21 | ||
@@ -30,7 +38,8 @@ async function processDeleteActivity (options: APProcessorOptions<ActivityDelete | |||
30 | } else if (byActorFull.type === 'Group') { | 38 | } else if (byActorFull.type === 'Group') { |
31 | if (!byActorFull.VideoChannel) throw new Error('Actor ' + byActorFull.url + ' is a group but we cannot find it in database.') | 39 | if (!byActorFull.VideoChannel) throw new Error('Actor ' + byActorFull.url + ' is a group but we cannot find it in database.') |
32 | 40 | ||
33 | const channelToDelete = Object.assign({}, byActorFull.VideoChannel, { Actor: byActorFull }) | 41 | const channelToDelete = byActorFull.VideoChannel as MChannelAccountActor & { Actor: MActorFull } |
42 | channelToDelete.Actor = byActorFull | ||
34 | return retryTransactionWrapper(processDeleteVideoChannel, channelToDelete) | 43 | return retryTransactionWrapper(processDeleteVideoChannel, channelToDelete) |
35 | } | 44 | } |
36 | } | 45 | } |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e9afb2c18..422bf6deb 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -2027,9 +2027,11 @@ export class VideoModel extends Model { | |||
2027 | } | 2027 | } |
2028 | 2028 | ||
2029 | setAsRefreshed () { | 2029 | setAsRefreshed () { |
2030 | this.changed('updatedAt', true) | 2030 | const options = { |
2031 | where: { id: this.id } | ||
2032 | } | ||
2031 | 2033 | ||
2032 | return this.save() | 2034 | return VideoModel.update({ updatedAt: new Date() }, options) |
2033 | } | 2035 | } |
2034 | 2036 | ||
2035 | requiresAuth () { | 2037 | requiresAuth () { |