+ function startTransaction (callbackWaterfall) {
+ db.sequelize.transaction({ isolationLevel: 'SERIALIZABLE' }).asCallback(function (err, t) {
+ return callbackWaterfall(err, t)
+ })
+ },
+
+ function findOrCreateAuthor (t, callbackWaterfall) {
+ const user = res.locals.oauth.token.User
+
+ const name = user.username
+ // null because it is OUR pod
+ const podId = null
+ const userId = user.id
+
+ db.Author.findOrCreateAuthor(name, podId, userId, t, function (err, authorInstance) {
+ return callbackWaterfall(err, t, authorInstance)
+ })
+ },
+
+ function findOrCreateTags (t, author, callbackWaterfall) {
+ const tags = videoInfos.tags
+
+ db.Tag.findOrCreateTags(tags, t, function (err, tagInstances) {
+ return callbackWaterfall(err, t, author, tagInstances)
+ })
+ },
+
+ function createVideoObject (t, author, tagInstances, callbackWaterfall) {