Skip to content

Commit

Permalink
Backend updated API links to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow committed Sep 17, 2017
1 parent 9fb75c0 commit 130eca4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function getSuggested(most_played, cb) {
for (var i=most_played.length-1;i>=0;i--) {
genres.push(most_played[i].genres[Math.floor(Math.random() * most_played[i].genres.length)]);
}
request(API_ROOT + '/api/GetSuggested/?genres=' + genres.join('|'), (error, response, body) => {
request(API_ROOT + '/api/v2/GetSuggested/' + genres.join('|'), (error, response, body) => {
if (error) return cb(null, {});
body = JSON.parse(body);
if (error || response.statusCode !== 200 || !body || body.error) return callback(true);
Expand Down Expand Up @@ -765,7 +765,7 @@ function getGameData(game_path, is_wud, callback) {
post_code = [xml.title_id._Data.slice(0, 8), '-', xml.title_id._Data.slice(8)].join('');
}

request(API_ROOT + '/api/GetGame/?' + post_type + '=' + post_code, (error, response, body) => {
request(API_ROOT + '/api/v2/GetGame/' + post_type + '/' + post_code, (error, response, body) => {
body = JSON.parse(body);
if (!body || body.error) return callback(true);
return callback(null, body)
Expand Down
61 changes: 54 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"ini": "^1.3.4",
"jimp": "^0.2.28",
"lowdb": "^0.17.2",
"mysql": "^2.14.1",
"pixl-xml": "^1.0.13",
"png-to-ico": "^1.0.3",
"request": "^2.81.0",
Expand Down

0 comments on commit 130eca4

Please sign in to comment.