databaseUtils.startSerializableTransaction,
+ function assertRemoteIdAndHostUnique (t, callback) {
+ db.Video.loadByHostAndRemoteId(fromPod.host, videoToCreateData.remoteId, function (err, video) {
+ if (err) return callback(err)
+
+ if (video) return callback(new Error('RemoteId and host pair is not unique.'))
+
+ return callback(null, t)
+ })
+ },
+
function findOrCreateAuthor (t, callback) {
const name = videoToCreateData.author
const podId = fromPod.id
describe('When adding a video', function () {
it('Should check when adding a video')
+
+ it('Should not add an existing remoteId and host pair')
})
describe('When removing a video', function () {