diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-24 13:41:10 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:53 +0100 |
commit | 63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd (patch) | |
tree | 3ee4b351025d4b19f6e880754df44fa7605b683d /server/models/video | |
parent | d4f1e94c89336255537b0b82913591f00e716201 (diff) | |
download | PeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.tar.gz PeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.tar.zst PeerTube-63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd.zip |
Correctly forward like/dislikes and undo
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e5fd92549..82b95c489 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -6,27 +6,8 @@ import { join } from 'path' | |||
6 | import * as Sequelize from 'sequelize' | 6 | import * as Sequelize from 'sequelize' |
7 | import { VideoPrivacy, VideoResolution } from '../../../shared' | 7 | import { VideoPrivacy, VideoResolution } from '../../../shared' |
8 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects/video-torrent-object' | 8 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects/video-torrent-object' |
9 | import { | ||
10 | createTorrentPromise, | ||
11 | generateImageFromVideoFile, | ||
12 | getVideoFileHeight, | ||
13 | isVideoCategoryValid, | ||
14 | isVideoDescriptionValid, | ||
15 | isVideoDurationValid, | ||
16 | isVideoLanguageValid, | ||
17 | isVideoLicenceValid, | ||
18 | isVideoNameValid, | ||
19 | isVideoNSFWValid, | ||
20 | isVideoPrivacyValid, | ||
21 | logger, | ||
22 | renamePromise, | ||
23 | statPromise, | ||
24 | transcode, | ||
25 | unlinkPromise, | ||
26 | writeFilePromise | ||
27 | } from '../../helpers' | ||
28 | import { activityPubCollection } from '../../helpers/activitypub' | 9 | import { activityPubCollection } from '../../helpers/activitypub' |
29 | import { isVideoUrlValid } from '../../helpers/custom-validators/videos' | 10 | import { isVideoCategoryValid, isVideoLanguageValid, isVideoPrivacyValid, isVideoUrlValid } from '../../helpers/custom-validators/videos' |
30 | import { | 11 | import { |
31 | API_VERSION, | 12 | API_VERSION, |
32 | CONFIG, | 13 | CONFIG, |
@@ -39,7 +20,7 @@ import { | |||
39 | VIDEO_LANGUAGES, | 20 | VIDEO_LANGUAGES, |
40 | VIDEO_LICENCES, | 21 | VIDEO_LICENCES, |
41 | VIDEO_PRIVACIES | 22 | VIDEO_PRIVACIES |
42 | } from '../../initializers' | 23 | } from '../../initializers/constants' |
43 | import { sendDeleteVideo } from '../../lib/index' | 24 | import { sendDeleteVideo } from '../../lib/index' |
44 | 25 | ||
45 | import { addMethodsToModel, getSort } from '../utils' | 26 | import { addMethodsToModel, getSort } from '../utils' |
@@ -47,6 +28,10 @@ import { addMethodsToModel, getSort } from '../utils' | |||
47 | import { TagInstance } from './tag-interface' | 28 | import { TagInstance } from './tag-interface' |
48 | import { VideoFileInstance, VideoFileModel } from './video-file-interface' | 29 | import { VideoFileInstance, VideoFileModel } from './video-file-interface' |
49 | import { VideoAttributes, VideoInstance, VideoMethods } from './video-interface' | 30 | import { VideoAttributes, VideoInstance, VideoMethods } from './video-interface' |
31 | import { isVideoNameValid, isVideoLicenceValid, isVideoNSFWValid, isVideoDescriptionValid, isVideoDurationValid } from '../../helpers/index' | ||
32 | import { logger } from '../../helpers/logger' | ||
33 | import { generateImageFromVideoFile, transcode, getVideoFileHeight } from '../../helpers/ffmpeg-utils' | ||
34 | import { createTorrentPromise, writeFilePromise, unlinkPromise, renamePromise, statPromise } from '../../helpers/core-utils' | ||
50 | 35 | ||
51 | let Video: Sequelize.Model<VideoInstance, VideoAttributes> | 36 | let Video: Sequelize.Model<VideoInstance, VideoAttributes> |
52 | let getOriginalFile: VideoMethods.GetOriginalFile | 37 | let getOriginalFile: VideoMethods.GetOriginalFile |
@@ -1013,6 +998,10 @@ loadAndPopulateAccountAndServerAndTags = function (id: number) { | |||
1013 | model: Video['sequelize'].models.AccountVideoRate, | 998 | model: Video['sequelize'].models.AccountVideoRate, |
1014 | include: [ Video['sequelize'].models.Account ] | 999 | include: [ Video['sequelize'].models.Account ] |
1015 | }, | 1000 | }, |
1001 | { | ||
1002 | model: Video['sequelize'].models.VideoShare, | ||
1003 | include: [ Video['sequelize'].models.Account ] | ||
1004 | }, | ||
1016 | Video['sequelize'].models.Tag, | 1005 | Video['sequelize'].models.Tag, |
1017 | Video['sequelize'].models.VideoFile | 1006 | Video['sequelize'].models.VideoFile |
1018 | ] | 1007 | ] |
@@ -1040,6 +1029,10 @@ loadByUUIDAndPopulateAccountAndServerAndTags = function (uuid: string) { | |||
1040 | model: Video['sequelize'].models.AccountVideoRate, | 1029 | model: Video['sequelize'].models.AccountVideoRate, |
1041 | include: [ Video['sequelize'].models.Account ] | 1030 | include: [ Video['sequelize'].models.Account ] |
1042 | }, | 1031 | }, |
1032 | { | ||
1033 | model: Video['sequelize'].models.VideoShare, | ||
1034 | include: [ Video['sequelize'].models.Account ] | ||
1035 | }, | ||
1043 | Video['sequelize'].models.Tag, | 1036 | Video['sequelize'].models.Tag, |
1044 | Video['sequelize'].models.VideoFile | 1037 | Video['sequelize'].models.VideoFile |
1045 | ] | 1038 | ] |