Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion build/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,14 @@ class Build {
* @async
*/
async saveImage(item, isComponent, duplicates, manifest) {
const imageBase = manifest.find((i) => i.uniqueName === item.uniqueName);
let { uniqueName } = item;
if (item.type === 'Nightwave Act') {
uniqueName = item.uniqueName.replace(/[0-9]{1,3}/, '');
}

const imageBase = manifest.find((i) => i.uniqueName === uniqueName);
if (!imageBase) return;

const imageStub = imageBase.textureLocation.replace(/\\/g, '/').replace('xport/', '');
const imageHash = imageStub.match(/!00_([\S]+)/);
const imageUrl = `https://content.warframe.com/PublicExport/${imageStub}`;
Expand Down
12 changes: 10 additions & 2 deletions build/parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class Parser {
.toLowerCase();
const imageStub = image.textureLocation;
const ext = imageStub.split('.')[imageStub.split('.').length - 1].replace(/\?!.*/, '').replace(/!.*$/, ''); // .png, .jpg, etc
const hash = createHash('sha256').update(item.uniqueName).digest('hex');
const hash = (str) => createHash('sha256').update(str).digest('hex');

// Enforce arcane and blueprint image name
if (item.name === 'Arcane') {
Expand All @@ -565,6 +565,14 @@ class Parser {
// the filesystem.
item.imageName = encode(item.name);

if (item.type === 'Nightwave Act') {
const name = item.name.replace(/\sM{0,3}(CM|CD|D?C{0,3})?(XC|XL|L?X{0,3})?(IX|IV|V?I{0,3})?$/i, '').trim();
const sterilized = item.uniqueName.replace(/[0-9]{1,3}$/, '');
item.imageName = `${encode(name)}-${hash(sterilized).slice(0, 10)}.${ext}`;

return;
}

// Components usually have the same generic images, so we should remove the
// parent name here. Note that there's a difference between prime/non-prime
// components, so we'll keep the prime in the name.
Expand Down Expand Up @@ -602,7 +610,7 @@ class Parser {
//
// Regex avoids Warframe componenets and Necramech weapons and suit
if (item.type !== 'Relic' && !/Recipes|(Resources\/Mechs)/.test(item.uniqueName)) {
item.imageName += `-${hash.slice(0, 10)}`;
item.imageName += `-${hash(item.uniqueName).slice(0, 10)}`;
}

// Add original file extension
Expand Down
9 changes: 8 additions & 1 deletion build/scraper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class Scraper {
const data = raw ? raw[`Export${category}`] : undefined;
bar.tick();

if (category === 'SortieRewards') {
data.push(...raw.ExportNightwave.challenges);
}

if (category === 'Weapons') data.push(...raw.ExportRailjackWeapons);

if (category === 'Warframes') {
Expand Down Expand Up @@ -178,7 +182,10 @@ class Scraper {
*/
async fetchDropRates(skipProgress) {
const bar = skipProgress ? undefined : new Progress('Fetching Drop Rates', 1);
const rates = await getJSON('https://drops.warframestat.us/data/all.slim.json', true);
const rates = await getJSON(
'https://raw.githubusercontent.com/WFCD/warframe-drop-data/refs/heads/main/data/all.slim.json',
true
);
if (!skipProgress) {
bar.tick();
}
Expand Down
6 changes: 5 additions & 1 deletion config/itemTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,5 +1057,9 @@
{
"id": "Tenno/Grimoire",
"name": "Tome"
},
{
"id": "Challenges/Seasons",
"name": "Nightwave Act"
}
]
]
Loading
Loading