{"action":"created","comment":{"url":"https://api.github.com/repos/metakirby5/niji/pulls/comments/77573689","id":77573689,"diff_hunk":"@@ -0,0 +1,152 @@\n+var express = require('express');\n+var multer = require('multer');\n+\n+var Theme = require('../../models/theme');\n+var Suite = require('../../models/suite');\n+\n+var router = express.Router();\n+var screenshotStorage =   multer.diskStorage({\n+  destination: function (req, file, callback) {\n+    callback(null, './uploads/screenshots');\n+  },\n+  filename: function (req, file, callback) {\n+    callback(null, req.body.name);\n+  }\n+});\n+var screenshotUpload = multer({\n+  storage: screenshotStorage,\n+  fileFilter: function(req, file, callback){\n+    if(file.mimetype.match(/image\\/.+/)){\n+      callback(null, true);\n+    }\n+    else{\n+      callback(null, false);\n+    }\n+  }\n+}).single('screenshot');\n+\n+var wallpaperStorage =   multer.diskStorage({\n+  destination: function (req, file, callback) {\n+    callback(null, './uploads/wallpapers');\n+  },\n+  filename: function (req, file, callback) {\n+    callback(null, req.body.name);\n+  }\n+});\n+var wallpaperUpload = multer({\n+  storage: wallpaperStorage,\n+  fileFilter: function(req, file, callback){\n+    if(file.mimetype.match(/image\\/.+/)){\n+      callback(null, true);\n+    }\n+    else{\n+      callback(null, false);\n+    }\n+  }\n+}).single('wallpaper');\n+\n+var authRoutes = require('./auth');\n+\n+router.use('/auth', authRoutes);\n+\n+router.post('/theme', function(req, res, next){\n+  Theme.find({name: req.body.name}, function(err, doc){\n+    if(err){\n+      return res.status(404).json({\n+        title: 'An error occurred',\n+        error: err\n+      });\n+    }\n+    if(doc){\n+      return res.status(409).json({\n+        message: 'A theme with that name already exists'\n+      });\n+    }\n+  });\n+  if(req.body.screenshot){\n+    upload(req, res, function(err){\n+      if(err){\n+        res.status(404).json({\n+          title: 'An error occurred',\n+          error: err\n+        });\n+      }\n+    });\n+  }\n+  var theme = new Theme({\n+    name: req.body.name,\n+    description: req.body.description,\n+    target: req.body.target,\n+    tags: req.body.tags,","path":"niji/routes/api/index.js","position":80,"original_position":80,"commit_id":"2fa3287120fa782a22a354c210834f9927d0d81c","original_commit_id":"2fa3287120fa782a22a354c210834f9927d0d81c","user":{"login":"metakirby5","id":3402603,"avatar_url":"https://avatars.githubusercontent.com/u/3402603?v=3","gravatar_id":"","url":"https://api.github.com/users/metakirby5","html_url":"https://github.com/metakirby5","followers_url":"https://api.github.com/users/metakirby5/followers","following_url":"https://api.github.com/users/metakirby5/following{/other_user}","gists_url":"https://api.github.com/users/metakirby5/gists{/gist_id}","starred_url":"https://api.github.com/users/metakirby5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metakirby5/subscriptions","organizations_url":"https://api.github.com/users/metakirby5/orgs","repos_url":"https://api.github.com/users/metakirby5/repos","events_url":"https://api.github.com/users/metakirby5/events{/privacy}","received_events_url":"https://api.github.com/users/metakirby5/received_events","type":"User","site_admin":false},"body":"Will this be properly processed as an array?","created_at":"2016-09-06T04:58:48Z","updated_at":"2016-09-06T04:58:48Z","html_url":"https://github.com/metakirby5/niji/pull/2#discussion_r77573689","pull_request_url":"https://api.github.com/repos/metakirby5/niji/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/comments/77573689"},"html":{"href":"https://github.com/metakirby5/niji/pull/2#discussion_r77573689"},"pull_request":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/metakirby5/niji/pulls/2","id":83939485,"html_url":"https://github.com/metakirby5/niji/pull/2","diff_url":"https://github.com/metakirby5/niji/pull/2.diff","patch_url":"https://github.com/metakirby5/niji/pull/2.patch","issue_url":"https://api.github.com/repos/metakirby5/niji/issues/2","number":2,"state":"open","locked":false,"title":"ebrock's stuff","user":{"login":"nuclearcoconut42","id":17294637,"avatar_url":"https://avatars.githubusercontent.com/u/17294637?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearcoconut42","html_url":"https://github.com/nuclearcoconut42","followers_url":"https://api.github.com/users/nuclearcoconut42/followers","following_url":"https://api.github.com/users/nuclearcoconut42/following{/other_user}","gists_url":"https://api.github.com/users/nuclearcoconut42/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearcoconut42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearcoconut42/subscriptions","organizations_url":"https://api.github.com/users/nuclearcoconut42/orgs","repos_url":"https://api.github.com/users/nuclearcoconut42/repos","events_url":"https://api.github.com/users/nuclearcoconut42/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearcoconut42/received_events","type":"User","site_admin":false},"body":":3","created_at":"2016-09-05T00:51:31Z","updated_at":"2016-09-06T04:58:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e25ff6acedbdaded64f34ece0ae98910d18a7bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/metakirby5/niji/pulls/2/commits","review_comments_url":"https://api.github.com/repos/metakirby5/niji/pulls/2/comments","review_comment_url":"https://api.github.com/repos/metakirby5/niji/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metakirby5/niji/issues/2/comments","statuses_url":"https://api.github.com/repos/metakirby5/niji/statuses/2fa3287120fa782a22a354c210834f9927d0d81c","head":{"label":"nuclearcoconut42:master","ref":"master","sha":"2fa3287120fa782a22a354c210834f9927d0d81c","user":{"login":"nuclearcoconut42","id":17294637,"avatar_url":"https://avatars.githubusercontent.com/u/17294637?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearcoconut42","html_url":"https://github.com/nuclearcoconut42","followers_url":"https://api.github.com/users/nuclearcoconut42/followers","following_url":"https://api.github.com/users/nuclearcoconut42/following{/other_user}","gists_url":"https://api.github.com/users/nuclearcoconut42/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearcoconut42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearcoconut42/subscriptions","organizations_url":"https://api.github.com/users/nuclearcoconut42/orgs","repos_url":"https://api.github.com/users/nuclearcoconut42/repos","events_url":"https://api.github.com/users/nuclearcoconut42/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearcoconut42/received_events","type":"User","site_admin":false},"repo":{"id":67375502,"name":"niji","full_name":"nuclearcoconut42/niji","owner":{"login":"nuclearcoconut42","id":17294637,"avatar_url":"https://avatars.githubusercontent.com/u/17294637?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearcoconut42","html_url":"https://github.com/nuclearcoconut42","followers_url":"https://api.github.com/users/nuclearcoconut42/followers","following_url":"https://api.github.com/users/nuclearcoconut42/following{/other_user}","gists_url":"https://api.github.com/users/nuclearcoconut42/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearcoconut42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearcoconut42/subscriptions","organizations_url":"https://api.github.com/users/nuclearcoconut42/orgs","repos_url":"https://api.github.com/users/nuclearcoconut42/repos","events_url":"https://api.github.com/users/nuclearcoconut42/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearcoconut42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nuclearcoconut42/niji","description":":books: YAML theme repo for use with zenbu.","fork":true,"url":"https://api.github.com/repos/nuclearcoconut42/niji","forks_url":"https://api.github.com/repos/nuclearcoconut42/niji/forks","keys_url":"https://api.github.com/repos/nuclearcoconut42/niji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuclearcoconut42/niji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuclearcoconut42/niji/teams","hooks_url":"https://api.github.com/repos/nuclearcoconut42/niji/hooks","issue_events_url":"https://api.github.com/repos/nuclearcoconut42/niji/issues/events{/number}","events_url":"https://api.github.com/repos/nuclearcoconut42/niji/events","assignees_url":"https://api.github.com/repos/nuclearcoconut42/niji/assignees{/user}","branches_url":"https://api.github.com/repos/nuclearcoconut42/niji/branches{/branch}","tags_url":"https://api.github.com/repos/nuclearcoconut42/niji/tags","blobs_url":"https://api.github.com/repos/nuclearcoconut42/niji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuclearcoconut42/niji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuclearcoconut42/niji/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuclearcoconut42/niji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuclearcoconut42/niji/statuses/{sha}","languages_url":"https://api.github.com/repos/nuclearcoconut42/niji/languages","stargazers_url":"https://api.github.com/repos/nuclearcoconut42/niji/stargazers","contributors_url":"https://api.github.com/repos/nuclearcoconut42/niji/contributors","subscribers_url":"https://api.github.com/repos/nuclearcoconut42/niji/subscribers","subscription_url":"https://api.github.com/repos/nuclearcoconut42/niji/subscription","commits_url":"https://api.github.com/repos/nuclearcoconut42/niji/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuclearcoconut42/niji/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuclearcoconut42/niji/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuclearcoconut42/niji/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuclearcoconut42/niji/contents/{+path}","compare_url":"https://api.github.com/repos/nuclearcoconut42/niji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuclearcoconut42/niji/merges","archive_url":"https://api.github.com/repos/nuclearcoconut42/niji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuclearcoconut42/niji/downloads","issues_url":"https://api.github.com/repos/nuclearcoconut42/niji/issues{/number}","pulls_url":"https://api.github.com/repos/nuclearcoconut42/niji/pulls{/number}","milestones_url":"https://api.github.com/repos/nuclearcoconut42/niji/milestones{/number}","notifications_url":"https://api.github.com/repos/nuclearcoconut42/niji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuclearcoconut42/niji/labels{/name}","releases_url":"https://api.github.com/repos/nuclearcoconut42/niji/releases{/id}","deployments_url":"https://api.github.com/repos/nuclearcoconut42/niji/deployments","created_at":"2016-09-05T00:27:17Z","updated_at":"2016-09-05T00:29:40Z","pushed_at":"2016-09-05T21:46:35Z","git_url":"git://github.com/nuclearcoconut42/niji.git","ssh_url":"git@github.com:nuclearcoconut42/niji.git","clone_url":"https://github.com/nuclearcoconut42/niji.git","svn_url":"https://github.com/nuclearcoconut42/niji","homepage":"https://niji.kirbi.es","size":305,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metakirby5:master","ref":"master","sha":"7ddc8cc2d6f71083347094f55ccd0d77c37728cf","user":{"login":"metakirby5","id":3402603,"avatar_url":"https://avatars.githubusercontent.com/u/3402603?v=3","gravatar_id":"","url":"https://api.github.com/users/metakirby5","html_url":"https://github.com/metakirby5","followers_url":"https://api.github.com/users/metakirby5/followers","following_url":"https://api.github.com/users/metakirby5/following{/other_user}","gists_url":"https://api.github.com/users/metakirby5/gists{/gist_id}","starred_url":"https://api.github.com/users/metakirby5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metakirby5/subscriptions","organizations_url":"https://api.github.com/users/metakirby5/orgs","repos_url":"https://api.github.com/users/metakirby5/repos","events_url":"https://api.github.com/users/metakirby5/events{/privacy}","received_events_url":"https://api.github.com/users/metakirby5/received_events","type":"User","site_admin":false},"repo":{"id":67338057,"name":"niji","full_name":"metakirby5/niji","owner":{"login":"metakirby5","id":3402603,"avatar_url":"https://avatars.githubusercontent.com/u/3402603?v=3","gravatar_id":"","url":"https://api.github.com/users/metakirby5","html_url":"https://github.com/metakirby5","followers_url":"https://api.github.com/users/metakirby5/followers","following_url":"https://api.github.com/users/metakirby5/following{/other_user}","gists_url":"https://api.github.com/users/metakirby5/gists{/gist_id}","starred_url":"https://api.github.com/users/metakirby5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metakirby5/subscriptions","organizations_url":"https://api.github.com/users/metakirby5/orgs","repos_url":"https://api.github.com/users/metakirby5/repos","events_url":"https://api.github.com/users/metakirby5/events{/privacy}","received_events_url":"https://api.github.com/users/metakirby5/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/metakirby5/niji","description":":rainbow: YAML theme repo for use with zenbu.","fork":false,"url":"https://api.github.com/repos/metakirby5/niji","forks_url":"https://api.github.com/repos/metakirby5/niji/forks","keys_url":"https://api.github.com/repos/metakirby5/niji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metakirby5/niji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metakirby5/niji/teams","hooks_url":"https://api.github.com/repos/metakirby5/niji/hooks","issue_events_url":"https://api.github.com/repos/metakirby5/niji/issues/events{/number}","events_url":"https://api.github.com/repos/metakirby5/niji/events","assignees_url":"https://api.github.com/repos/metakirby5/niji/assignees{/user}","branches_url":"https://api.github.com/repos/metakirby5/niji/branches{/branch}","tags_url":"https://api.github.com/repos/metakirby5/niji/tags","blobs_url":"https://api.github.com/repos/metakirby5/niji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metakirby5/niji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metakirby5/niji/git/refs{/sha}","trees_url":"https://api.github.com/repos/metakirby5/niji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metakirby5/niji/statuses/{sha}","languages_url":"https://api.github.com/repos/metakirby5/niji/languages","stargazers_url":"https://api.github.com/repos/metakirby5/niji/stargazers","contributors_url":"https://api.github.com/repos/metakirby5/niji/contributors","subscribers_url":"https://api.github.com/repos/metakirby5/niji/subscribers","subscription_url":"https://api.github.com/repos/metakirby5/niji/subscription","commits_url":"https://api.github.com/repos/metakirby5/niji/commits{/sha}","git_commits_url":"https://api.github.com/repos/metakirby5/niji/git/commits{/sha}","comments_url":"https://api.github.com/repos/metakirby5/niji/comments{/number}","issue_comment_url":"https://api.github.com/repos/metakirby5/niji/issues/comments{/number}","contents_url":"https://api.github.com/repos/metakirby5/niji/contents/{+path}","compare_url":"https://api.github.com/repos/metakirby5/niji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metakirby5/niji/merges","archive_url":"https://api.github.com/repos/metakirby5/niji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metakirby5/niji/downloads","issues_url":"https://api.github.com/repos/metakirby5/niji/issues{/number}","pulls_url":"https://api.github.com/repos/metakirby5/niji/pulls{/number}","milestones_url":"https://api.github.com/repos/metakirby5/niji/milestones{/number}","notifications_url":"https://api.github.com/repos/metakirby5/niji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metakirby5/niji/labels{/name}","releases_url":"https://api.github.com/repos/metakirby5/niji/releases{/id}","deployments_url":"https://api.github.com/repos/metakirby5/niji/deployments","created_at":"2016-09-04T10:13:13Z","updated_at":"2016-09-05T05:46:18Z","pushed_at":"2016-09-05T21:46:35Z","git_url":"git://github.com/metakirby5/niji.git","ssh_url":"git@github.com:metakirby5/niji.git","clone_url":"https://github.com/metakirby5/niji.git","svn_url":"https://github.com/metakirby5/niji","homepage":"https://niji.kirbi.es","size":299,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/2"},"html":{"href":"https://github.com/metakirby5/niji/pull/2"},"issue":{"href":"https://api.github.com/repos/metakirby5/niji/issues/2"},"comments":{"href":"https://api.github.com/repos/metakirby5/niji/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metakirby5/niji/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/metakirby5/niji/statuses/2fa3287120fa782a22a354c210834f9927d0d81c"}}}}
{"actor":{"display_login":"metakirby5"}}