Skip to content

Commit

Permalink
#1 Pulled orchestrion list data.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDonnelly committed Jun 2, 2019
1 parent a86afab commit 22ccad1
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion data/content/emotes.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/content/orchestrion.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/config/emotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
'Icon',
'IconID',
'ID',
...helper.localisedColumnProperty(`Name`)
...helper.localisedColumnProperty(`Name`),
'UnlockLink'
],
isPaginated: true,
method: 'fetch',
Expand Down
16 changes: 16 additions & 0 deletions src/config/orchestrion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const helper = require('../xivapi/helper');

module.exports = {
list: {
columns: [
...helper.localisedColumnProperty(`Description`),
'GamePatch.ID',
'ID',
...helper.localisedColumnProperty(`Name`),
'OrchestrionUiparam'
],
isPaginated: true,
method: 'fetch',
name: 'Orchestrion'
}
};
34 changes: 26 additions & 8 deletions src/parsers/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ module.exports = (data, config) => {
name
} = config;

const parsed = data.map(content => {
const parsed = data.filter(content => {
// Content without an English name can be ignored.
if (!content.Name_en) {
return false;
}

switch (name) {
/**
* Some achievements have no category. Those ones aren't accessible in the game and never
* have been.
*/
case 'Achievements':
return !!content.AchievementCategory;
}

return true;
}).map(content => {
const response = {
name: helper.getLocalisedNamesObject(content),
patch: content.GamePatch.ID
Expand All @@ -20,13 +36,8 @@ module.exports = (data, config) => {

switch (name) {
case 'Achievements':
if (content.AchievementCategory) {
response.category = content.AchievementCategory.ID;
response.kind = content.AchievementCategory.AchievementKind.ID;
} else {
response.category = -1;
response.kind = -1;
}
response.category = content.AchievementCategory.ID;
response.kind = content.AchievementCategory.AchievementKind.ID;
response.description = helper.getLocalisedNamesObject(content, 'Description');
response.points = content.Points;
break;
Expand All @@ -45,6 +56,13 @@ module.exports = (data, config) => {

case 'Emotes':
response.category = content.EmoteCategoryTargetID;
response.link = content.UnlockLink;
break;

case 'Orchestrion':
response.category = content.OrchestrionUiparam.OrchestrionCategoryTargetID;
response.description = helper.getLocalisedNamesObject(content, 'Description');
response.order = content.OrchestrionUiparam.Order;
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class API {
'emotes',
'minions',
'mounts',
'orchestrion',

// Icon images and sprite sheets.
'icons'
Expand Down
1 change: 1 addition & 0 deletions src/xivapi/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
minions: () => `${xivapiBase}/companion`,
mount: (id) => `${xivapiBase}/mount/${id}`,
mounts: () => `${xivapiBase}/mount`,
orchestrion: () => `${xivapiBase}/orchestrion`,
search: () => `${xivapiBase}/search`,
spearfishingItems: () => `${xivapiBase}/spearfishingitem`,
territoryTypes: () => `${xivapiBase}/territorytype`
Expand Down

0 comments on commit 22ccad1

Please sign in to comment.