rizzzigit/jikan4.js

Character pictures do not pull properly

Closed this issue · 3 comments

Doing .characters.getPictures(ID) results in everything being null due to the URL patch being different than the source codes.

Personally, I'd rather have it that the pictures of the characters come from .anime/manga.getCharacters(id) because the name of the character could assist with the source code.

Current code:

  public async getPictures (characterId: number): Promise<Array<Image> | undefined> {
    const rawData = await this.request(`characters/${characterId}/pictures`)

    return rawData ? rawData.map((picture: any) => new Image(this.client, picture)) : undefined
  }
}

My anime list character url example: https://myanimelist.net/character/737/Kouta/pics

The source code is missing the /characterName/ after the ID resulting in all nulls.

I do believe to be the same with other picture results however I have not tested them all. (Anime pictures, manga ect for the .getPictures method)

Hello, thanks for catching this issue, it has been fixed in the recent version of jikan4.js.

Regarding the character URL: I am not sure what you mean by missing /characterName/ in the source code. If you meant adding it to the request uri, I don't think it's required by Jikan API.

Hey so, I thought I had noticed an inconsistency from the source code and api however I realized that I did not and the information provided was incorrect. You did fix the issues i had before so no further work should be needed done lol. I’ll be posted anything else I find in a new issue but everything seems to be working as intended. I appreciate your work, thank you.