diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-04 14:16:57 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | 68e70a745b2010cd0199864a2addd60d8f99c732 (patch) | |
tree | a0b1b061d205321e0f6eb80e5b44d7afd06aab14 /server/models | |
parent | 97969c4edf51b37eee691adba43368bb0fbb729b (diff) | |
download | PeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.tar.gz PeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.tar.zst PeerTube-68e70a745b2010cd0199864a2addd60d8f99c732.zip |
Add save replay live tests
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 7e008f7ea..8e71f8c32 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -25,7 +25,7 @@ import { | |||
25 | UpdatedAt | 25 | UpdatedAt |
26 | } from 'sequelize-typescript' | 26 | } from 'sequelize-typescript' |
27 | import { buildNSFWFilter } from '@server/helpers/express-utils' | 27 | import { buildNSFWFilter } from '@server/helpers/express-utils' |
28 | import { getPrivaciesForFederation, isPrivacyForFederation } from '@server/helpers/video' | 28 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' |
29 | import { LiveManager } from '@server/lib/live-manager' | 29 | import { LiveManager } from '@server/lib/live-manager' |
30 | import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' | 30 | import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' |
31 | import { getServerActor } from '@server/models/application/application' | 31 | import { getServerActor } from '@server/models/application/application' |
@@ -823,6 +823,8 @@ export class VideoModel extends Model<VideoModel> { | |||
823 | static stopLiveIfNeeded (instance: VideoModel) { | 823 | static stopLiveIfNeeded (instance: VideoModel) { |
824 | if (!instance.isLive) return | 824 | if (!instance.isLive) return |
825 | 825 | ||
826 | logger.info('Stopping live of video %s after video deletion.', instance.uuid) | ||
827 | |||
826 | return LiveManager.Instance.stopSessionOf(instance.id) | 828 | return LiveManager.Instance.stopSessionOf(instance.id) |
827 | } | 829 | } |
828 | 830 | ||
@@ -1921,6 +1923,10 @@ export class VideoModel extends Model<VideoModel> { | |||
1921 | return isPrivacyForFederation(this.privacy) | 1923 | return isPrivacyForFederation(this.privacy) |
1922 | } | 1924 | } |
1923 | 1925 | ||
1926 | hasStateForFederation () { | ||
1927 | return isStateForFederation(this.state) | ||
1928 | } | ||
1929 | |||
1924 | isNewVideo (newPrivacy: VideoPrivacy) { | 1930 | isNewVideo (newPrivacy: VideoPrivacy) { |
1925 | return this.hasPrivacyForFederation() === false && isPrivacyForFederation(newPrivacy) === true | 1931 | return this.hasPrivacyForFederation() === false && isPrivacyForFederation(newPrivacy) === true |
1926 | } | 1932 | } |