ActivityPub-federated video streaming platform using P2P directly in your web browser
Stop live before removing files
Chocobozzza1d93180668a
diff --git a/server/server/models/video/video.ts b/server/server/models/video/video.tsindex a6383b7c7e..44d0605cc4 100644--- a/server/server/models/video/video.ts+++ b/server/server/models/video/video.ts@@ -796,6 +796,20 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {InternalEventEmitter.Instance.emit('video-deleted', { video })}+ @BeforeDestroy+ static stopLiveIfNeeded (instance: VideoModel) {+ if (!instance.isLive) return++ logger.info('Stopping live of video %s after video deletion.', instance.uuid)++ LiveManager.Instance.stopSessionOf(instance.uuid, null)+ }++ @BeforeDestroy+ static invalidateCache (instance: VideoModel) {+ ModelCache.Instance.invalidateCache('video', instance.id)+ }+@BeforeDestroystatic async sendDelete (instance: MVideoAccountLight, options: { transaction: Transaction }) {if (!instance.isOwned()) return undefined@@ -848,20 +862,6 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {return undefined}- @BeforeDestroy- static stopLiveIfNeeded (instance: VideoModel) {- if (!instance.isLive) return-- logger.info('Stopping live of video %s after video deletion.', instance.uuid)-- LiveManager.Instance.stopSessionOf(instance.uuid, null)- }-- @BeforeDestroy- static invalidateCache (instance: VideoModel) {- ModelCache.Instance.invalidateCache('video', instance.id)- }-@BeforeDestroystatic async saveEssentialDataToAbuses (instance: VideoModel, options) {const tasks: Promise<any>[] = []