ckatzorke / howlongtobeat

A simple api for https://howlongtobeat.com/
Do What The F*ck You Want To Public License
338 stars 45 forks source link

Incorrect timeLabels mapping for `detail()` function #26

Open GamerKingFaiz opened 2 years ago

GamerKingFaiz commented 2 years ago

Run the following code:

hltbService.detail('36936').then(result => console.log(result)).catch(e => console.error(e));

You get the following result:

{
    "id": 36936,
    "name": "Nioh",
    "description": " Nioh follows the story of William, loosely based upon William Adams, a blond-haired Samurai and son of a Japanese lord and a Western woman during the Warring States period in 17th-century Japan.\n\t\t\t\n\t\t\t\tWhen focusing on the main objectives, \n\t\t\t\tNioh\n\t\t\t\tis about \n\t\t\t\t35½ Hours \n\t\t\t\tin length. \n\t\t\t\tIf you're a gamer that strives to see all aspects of the game, you are likely to spend around\n\t\t\t\t96 Hours \n\t\t\t\tto obtain 100% completion.\n\t\t\t",
    "platforms": [
        "PC",
        "PlayStation 4"
    ],
    "imageUrl": "/games/36936_Nioh.jpg",
    "timeLabels": [
        [
            "gameplayMain",
            "Main Story"
        ],
        [
            "gameplayMainExtra",
            "Main + Extras"
        ],
        [
            "gameplayComplete",
            "Completionist"
        ]
    ],
    "gameplayMain": 35.5,
    "gameplayMainExtra": 64.5,
    "gameplayCompletionist": 96,
    "similarity": 1,
    "searchTerm": "Nioh",
    "playableOn": [
        "PC",
        "PlayStation 4"
    ]
}

The time label for "Completionist" is gameplayComplete, whereas the key in the HowLongToBeatEntry is gameplayCompletionist.

The time labels for the search() function are returned properly, for what it's worth.