esi / esi-issues

Issue tracking and feature requests for ESI
https://esi.evetech.net/
207 stars 23 forks source link

Add "standard" / "primary" item image category to esi #1154

Open Provagus opened 4 years ago

Provagus commented 4 years ago

Feature Request

New image server has different categories for different items. Most of them has icon category, but not all. Blueprints have for example bp and bpc endpoints. In case of blueprints it's easy to identify them due to word "blueprint" in item name. There are also other types of items like "Malfunctioning Thruster Sections". They have only "relic" image category. (Probably there are also other items with "special" categories). Calling https://images.evetech.net/types/30558/icon gives error. I can't know about it unless I make some list with all special items or I ping server. It force me to call all images with "icon" category or ping image server to get categories and then call it again to get image. It doubles number of calls and slows both my and image server service. Adding main image category to returned items in endpoints like /universe/types/{type_id}/, /characters/{character_id}/assets/, etc would solve that problem

Use case

Services switching into new image server. Showing item images on services like evepraisal, evemarketer, seat, etc

Authentication

Without changes

Example return

{
  "capacity": 0,
  "description": "After millennia of exposure to space, these thruster sections have begun to wear significantly, offering only a limited example of their full functionality. The modular design of Sleeper propulsion systems is still observable however, and is notably similar to that of the empires, only deviating in a few interesting areas.\r\n\r\nA determined and lucky researcher could still successfully reverse engineer something useful from this, but they would certainly stand a better chance with a more functional design. ",
  "dogma_attributes": [
    {
      "attribute_id": 161,
      "value": 10
    },
    {
      "attribute_id": 162,
      "value": 0
    },
    {
      "attribute_id": 1955,
      "value": 2
    },
    {
      "attribute_id": 4,
      "value": 0
    },
    {
      "attribute_id": 38,
      "value": 0
    }
  ],
  "group_id": 971,
  "icon_id": 3738,
  "market_group_id": 1909,
  "mass": 0,
  "name": "Malfunctioning Thruster Sections",
  "packaged_volume": 10,
  "portion_size": 1,
  "published": true,
  "radius": 1,
  "type_id": 30558,
  "volume": 10,
  "primary_image_category" : "relic"
}

Checklist

Check all boxes that apply to this issue:

Provagus commented 4 years ago

Redirecting "icon" to primary category should also work or eventually being able to call variation by id, not string. Like https://images.evetech.net/types/30558/0

mateuszkrasucki commented 4 years ago

The correct way at the moment is the one mentioned, fetch categories from image server beforehand. To be considered but we don't give it anything close to high prio.

Provagus commented 4 years ago

The correct way at the moment is the one mentioned, fetch categories from image server beforehand. To be considered but we don't give it anything close to high prio.

The way I added later (https://images.evetech.net/types/30558/0 returning same as https://images.evetech.net/types/30558/relic) would also work and it would be less work to implement. Devs not interested in image variations would just call 0 as type for all images and always get valid response.