X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fredundancy%2Fvideo-redundancy.ts;h=6f84747da7a69aa05a9741d4942c20bd3fad5307;hb=2b621ac0ebe83693bba6354b3482a03ba58143e7;hp=ccda023e018388bcfabb7a5f4153946c6cd0ffb6;hpb=a7944e89bcd0a58fecc2ebd6a98e1674bd4173bb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index ccda023e0..6f84747da 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -16,15 +16,17 @@ import { } from 'sequelize-typescript' import { getServerActor } from '@server/models/application/application' import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models' -import { AttributesOnly } from '@shared/core-utils' -import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model' import { + CacheFileObject, FileRedundancyInformation, StreamingPlaylistRedundancyInformation, - VideoRedundancy -} from '@shared/models/redundancy/video-redundancy.model' -import { CacheFileObject, VideoPrivacy } from '../../../shared' -import { VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '../../../shared/models/redundancy' + VideoPrivacy, + VideoRedundanciesTarget, + VideoRedundancy, + VideoRedundancyStrategy, + VideoRedundancyStrategyWithManual +} from '@shared/models' +import { AttributesOnly } from '@shared/typescript-utils' import { isTestInstance } from '../../helpers/core-utils' import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc' import { logger } from '../../helpers/logger' @@ -160,8 +162,8 @@ export class VideoRedundancyModel extends Model logger.error('Cannot delete %s files.', logIdentifier, { err })) + videoFile.Video.removeWebTorrentFileAndTorrent(videoFile, true) + .catch(err => logger.error('Cannot delete %s files.', logIdentifier, { err })) } if (instance.videoStreamingPlaylistId) { @@ -411,7 +413,7 @@ export class VideoRedundancyModel extends Model { const actor = await getServerActor() const query = { @@ -470,16 +472,34 @@ export class VideoRedundancyModel extends Model