WFCD / warframe-items

📘 Get all Warframe items directly from Warframe's API. No more messy wikia scraping.
MIT License
279 stars 53 forks source link

[Bug] Missing hash on img files #636

Closed NicolasFlamel closed 3 weeks ago

NicolasFlamel commented 4 weeks ago

Describe the bug

Some images are missing hash

NodeJS Version

v22.9.0

npm Version

v10.8.6

warframe-items Version

v1.1263.40

Access Method

npm Package (Default)

What happened?

Most items work but a few have imageNames that don't match up with file names in data/img.

For example, the Akstiletto imageName is akstiletto-5d5e77400c.png, but is just akstiletto.png in data/img.

Other examples that fail to fetch but I did not look into include:

My guess is that the affected items are all weapons that are used as components to craft other items and that messed up the file naming. If you look at the Akstiletto as a component inside of Aksomati it uses the old imageName akstiletto.png.

P.S. The current https://cdn.warframestat.us/img/${item.imageName} link does not work as the site is currently using the old warframe-items version which has the old imageNames.

SlayerOrnstein commented 4 weeks ago

image image

Yeah, just have to wait for the cache to either invalidate or purge and Bronco Prime, yeah that's just missing entirely

SlayerOrnstein commented 4 weeks ago
import 'dart:convert';
import 'package:crypto/crypto.dart';

void main() {
  const uniqueName = '/Lotus/Weapons/Tenno/Pistol/HandShotGun';
  final hash = sha256.convert(utf8.encode(uniqueName)).toString();

// Don't generate for component images, relics, blueprint image, and
// generic arcane entries
  print('https://cdn.warframestat.us/img/branco-${hash.substring(0, 10)}.png');
}

Here's a quick work around, it's in dart but that's the gist of it

NicolasFlamel commented 4 weeks ago

Sorry, I might be missing something or it might not have been apparent from the initial message but these issues are happening all locally without the use of the CDN.

Some of the file names in the repo do not have the hash in the file name. So when when you try to get the image from the repo, for example Bronco: https://raw.githubusercontent.com/wfcd/warframe-items/master/data/img/bronco-65d3eb546d.png, it will give a 404 and instead it will be found without the hash, https://raw.githubusercontent.com/wfcd/warframe-items/master/data/img/bronco.png.

SlayerOrnstein commented 4 weeks ago

I think it's Github caching the previous version of the branch due to the size of commit, at least from what I'm seeing

edit: nope for some reason the file did not save with the image name

SlayerOrnstein commented 4 weeks ago

Yup, name wasn't sticking due to it being a component not entirely sure why and I'll look more into that one later. I'll try to have a fix out in a few

SlayerOrnstein commented 3 weeks ago

@NicolasFlamel let me know if that fixes things for you. If you use the API you might have to wait till it deploys first

wfcd-bot-boi commented 3 weeks ago

:tada: This issue has been resolved in version 1.1263.47 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

NicolasFlamel commented 3 weeks ago

@NicolasFlamel let me know if that fixes things for you. If you use the API you might have to wait till it deploys first

@SlayerOrnstein It seems to be partially fixed. While most of the broken ones from earlier are fixed the only ones left are some prime parts that are components of their Ak-weapon versions. These specific weapon image file names now have the word "prime" at the start of the file which contradicts the imageName on the non-ak version of the weapon but match on the component version of the item.

Affected items

Example

I can use the Lex prime as an example to make things clearer. If you look at Lex Prime, it's imageName is "lex-prime-547afa0c65.png" but the matching image file is prime-lex-prime-547afa0c65.png.

When looking at Aklex Prime then at it's component, Lex Prime, it's imageName is "prime-lex-prime-547afa0c65.png" which matches the file name.

Lex Prime: { "name": "Lex Prime", "imageName": "lex-prime-547afa0c65.png" }

Aklex Prime: { "name": "Aklex Prime", "components": [{ "name": "Lex Prime", "imageName": "prime-lex-prime-547afa0c65.png" }] }

wfcd-bot-boi commented 3 weeks ago

:tada: This issue has been resolved in version 1.1263.49 :tada:

The release is available on:

Your semantic-release bot :package::rocket: