diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-16 15:55:01 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:52 +0100 |
commit | d7d5611c8a23de9b483f0437ad3469afef7b8805 (patch) | |
tree | 35f8f77e5f211a65f8be3c967e939f83c7e17d29 /server/models/video/video.ts | |
parent | 20494f122186bb1bfd82f4c598c4744acea27b0c (diff) | |
download | PeerTube-d7d5611c8a23de9b483f0437ad3469afef7b8805.tar.gz PeerTube-d7d5611c8a23de9b483f0437ad3469afef7b8805.tar.zst PeerTube-d7d5611c8a23de9b483f0437ad3469afef7b8805.zip |
Federate video update
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 64ee7ae34..5b0377c2e 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -84,6 +84,7 @@ let loadByHostAndUUID: VideoMethods.LoadByHostAndUUID | |||
84 | let listOwnedAndPopulateAccountAndTags: VideoMethods.ListOwnedAndPopulateAccountAndTags | 84 | let listOwnedAndPopulateAccountAndTags: VideoMethods.ListOwnedAndPopulateAccountAndTags |
85 | let listOwnedByAccount: VideoMethods.ListOwnedByAccount | 85 | let listOwnedByAccount: VideoMethods.ListOwnedByAccount |
86 | let load: VideoMethods.Load | 86 | let load: VideoMethods.Load |
87 | let loadByUrlAndPopulateAccount: VideoMethods.LoadByUrlAndPopulateAccount | ||
87 | let loadByUUID: VideoMethods.LoadByUUID | 88 | let loadByUUID: VideoMethods.LoadByUUID |
88 | let loadByUUIDOrURL: VideoMethods.LoadByUUIDOrURL | 89 | let loadByUUIDOrURL: VideoMethods.LoadByUUIDOrURL |
89 | let loadLocalVideoByUUID: VideoMethods.LoadLocalVideoByUUID | 90 | let loadLocalVideoByUUID: VideoMethods.LoadLocalVideoByUUID |
@@ -271,6 +272,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da | |||
271 | listOwnedAndPopulateAccountAndTags, | 272 | listOwnedAndPopulateAccountAndTags, |
272 | listOwnedByAccount, | 273 | listOwnedByAccount, |
273 | load, | 274 | load, |
275 | loadByUrlAndPopulateAccount, | ||
274 | loadAndPopulateAccount, | 276 | loadAndPopulateAccount, |
275 | loadAndPopulateAccountAndServerAndTags, | 277 | loadAndPopulateAccountAndServerAndTags, |
276 | loadByHostAndUUID, | 278 | loadByHostAndUUID, |
@@ -936,6 +938,25 @@ loadByUUID = function (uuid: string, t?: Sequelize.Transaction) { | |||
936 | return Video.findOne(query) | 938 | return Video.findOne(query) |
937 | } | 939 | } |
938 | 940 | ||
941 | loadByUrlAndPopulateAccount = function (url: string, t?: Sequelize.Transaction) { | ||
942 | const query: Sequelize.FindOptions<VideoAttributes> = { | ||
943 | where: { | ||
944 | url | ||
945 | }, | ||
946 | include: [ | ||
947 | Video['sequelize'].models.VideoFile, | ||
948 | { | ||
949 | model: Video['sequelize'].models.VideoChannel, | ||
950 | include: [ Video['sequelize'].models.Account ] | ||
951 | } | ||
952 | ] | ||
953 | } | ||
954 | |||
955 | if (t !== undefined) query.transaction = t | ||
956 | |||
957 | return Video.findOne(query) | ||
958 | } | ||
959 | |||
939 | loadByUUIDOrURL = function (uuid: string, url: string, t?: Sequelize.Transaction) { | 960 | loadByUUIDOrURL = function (uuid: string, url: string, t?: Sequelize.Transaction) { |
940 | const query: Sequelize.FindOptions<VideoAttributes> = { | 961 | const query: Sequelize.FindOptions<VideoAttributes> = { |
941 | where: { | 962 | where: { |