nftchef / art-engine

An advanced fork of the HashLips Art Engine with additional features to generate complex art from provided layers using the familiar Hashlips setup.
MIT License
427 stars 203 forks source link

Fix for calculating rarity data with identical sub directory names as the layer #251

Closed seibelj closed 1 year ago

seibelj commented 2 years ago

When sub directories contained the same string as the layer name, the split() would cause the path manipulation logic to fail. This fix makes the the string split on layers/${layer.name} which ensures only the highest level layer folder is split.

To reproduce this issue, imagine the layer is Eyes and the subdir is Eyes_Green. The folder is layers/Eyes/Eyes_Green/...

The split() would split on both Eyes and Eyes_Green causing the folder reading logic to fail.

nftchef commented 1 year ago

Thank you! the old utils/rarityData.js script has been deprecated in favor of the newer CSV output, utils/rarity.js