JS16_ProjectA icon indicating copy to clipboard operation
JS16_ProjectA copied to clipboard

Issue with api/plod/bySlug

Open yashha opened this issue 9 years ago • 5 comments

First there should be a strict option and this url https://api.got.show/api/plod/bySlug/Aegon_Targaryen_(son_of_Rhaegar) gives only one algorithm back but this https://api.got.show/api/plod/bySlug/Aegon_Targaryen gives also the other algorithm back

yashha avatar Apr 08 '16 22:04 yashha

I guess this is to attribute to the group that implemented the gotarffplod. They reformatted the names which are returned from the call of that-plod-for-that-char, apparently. There are two solutions to this:

  1. @nicoladesocio @konstantinos-angelo @dan736923 @s-feng @AlexMoroz how much hassle would it be to make the name coincide with the input name? If that is actually the issue here
  2. @Adiolis I guess you take the object returned by the .getPlod function of gotarffplod which contains the name without parenthesis. Would it be possible to, when saving to the db, instead of using that name, using the original name passed to the function?

@yashha as a side note, there are some (few) cases in which there are predictions for one alg and not for the otherone, as well as some cases in which there are no predictions at all

sacdallago avatar Apr 09 '16 09:04 sacdallago

Yes, the character names are reformatted. "Aegon Targaryen (son of Rhaegar)" originally --> "aegon targaryen son of rhaegar" in JSON files of group 7

As far as I can see, you used getAllCharPredictions() to get a map with these reformatted names: {'aegon targaryen son of rhaegar': 0.826, ...}

A simple solution is to use getPlod(name), which simply does this: return map[ name.toString().toLowerCase().replace(/['()]/g, '') ];

dan736923 avatar Apr 09 '16 16:04 dan736923

I think the way to tweak this is to override it before saving it to the db, @Adiolis ? @boriside @togiberlin @kordianbruck

sacdallago avatar Apr 09 '16 21:04 sacdallago

Also I found out that the slugs are inconsistent: https://api.got.show/api/plod/bySlug/Rus "character": "Rus", "character": "rus",

yashha avatar Apr 10 '16 13:04 yashha

Also this is not returning both plods :( https://api.got.show/api/plod/bySlug/Daella_Targaryen_(daughter_of_Maekar_I)

yashha avatar Apr 10 '16 14:04 yashha