diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/remote/videos.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/controllers/api/remote/videos.js b/server/controllers/api/remote/videos.js index 83d9b98bf..f8b4949cd 100644 --- a/server/controllers/api/remote/videos.js +++ b/server/controllers/api/remote/videos.js | |||
@@ -79,6 +79,16 @@ function addRemoteVideo (videoToCreateData, fromPod, finalCallback) { | |||
79 | 79 | ||
80 | databaseUtils.startSerializableTransaction, | 80 | databaseUtils.startSerializableTransaction, |
81 | 81 | ||
82 | function assertRemoteIdAndHostUnique (t, callback) { | ||
83 | db.Video.loadByHostAndRemoteId(fromPod.host, videoToCreateData.remoteId, function (err, video) { | ||
84 | if (err) return callback(err) | ||
85 | |||
86 | if (video) return callback(new Error('RemoteId and host pair is not unique.')) | ||
87 | |||
88 | return callback(null, t) | ||
89 | }) | ||
90 | }, | ||
91 | |||
82 | function findOrCreateAuthor (t, callback) { | 92 | function findOrCreateAuthor (t, callback) { |
83 | const name = videoToCreateData.author | 93 | const name = videoToCreateData.author |
84 | const podId = fromPod.id | 94 | const podId = fromPod.id |