kodadot / nft-gallery

Generative Art Marketplace
https://koda.art
MIT License
643 stars 362 forks source link

Sorting Aphabetically not working #7398

Open JustLuuuu opened 1 year ago

JustLuuuu commented 1 year ago

Sorting collection Alphabetically is not working on any chain - I tested it an landing and on canary.

here I selected to sort alphabetically:

Screenshot 2023-09-28 at 11 47 44

Video example:

https://github.com/kodadot/nft-gallery/assets/104380776/a8a324d8-748a-41c7-bef3-761f27da9210

roiLeo commented 1 year ago

This is excepted result as we sort by SerialNumber Alphabetically ref #5962

I would close this one as won't fix

JustLuuuu commented 1 year ago

Ahhh Im confused by serial number sorting.. I thought NFTs would be sorted correctly if they had serial number in name: Like: NFT #1.....NFT #2....NFT#3

What serial number do the NFTs in the Sub0 collection have in a name? They are sorted by what serial number? I don't see any in the name.

If you check this old collection that started this discussion: https://kodadot.xyz/rmrk/collection/08C79124CAC59DC643-BOREDBARRO?sort=instance_ASC and

This sorting is all messed up.

roiLeo commented 1 year ago

Ahhh Im confused by serial number sorting.. I thought NFTs would be sorted correctly if they had serial number in name: Like: NFT #1.....NFT #2....NFT#3

No, serial num is converted as string

0 < 1 < 10 < 100 < 1000 < 101 I know that sound weird

Capture d’écran 2023-09-28 à 2 49 08 PM

What serial number do the NFTs in the Sub0 collection have in a name? They are sorted by what serial number? I don't see any in the name.

it's in nft name

If you check this old collection that started this discussion: https://kodadot.xyz/rmrk/collection/08C79124CAC59DC643-BOREDBARRO?sort=instance_ASC and

not same chain, not same spec, not same nft name

This sorting is all messed up.

may @vikiival provide more answers

vikiival commented 1 year ago

not same chain, not same spec, not same nft name

Yup

What can we do?

Except rmrk, ksm I can convert sn to BigInt! type so we can have more unified sorting based on that so for: bsx and ah* This would also help in future integrations

In case of Kusama NFTs I unfortunatelly cannot help as sn is defined as

  "sn": {
    "type": "string",
    "description": "Serial number or issuance number of the NFT, padded so that its total length is 8, e.g. 00000123. Should be sequential but can be arbitrary - the `max` propery of an NFT's collection only cares about the total number of NFTs, not their serial numbers."
  }

Probably need to check how does it behave on the indexer side and maaaaybe we can find something