#"gamebook:" comments in the study PGN API?

4 messages · Page 1 of 1 (latest)

thorny vigil
#

I'm working on implementing studies for the mobile app.

I'm currently using the public /api/study/<id>.pgn endpoint, as with the PGN format I can conveniently reuse a lot of code from the analysis board.

However, I noticed that when the study chapter mode is "Interactive lesson", some of the comments are missing from the PGN, like "hints" and the comment of "When any other wrong move is played:"

It looks like they are only included in the internal /study/<id> JSON representation (treeParts) - Is there no way around parsing treeParts for me? Maybe we could include those special comments in the PGN with some kind of special tag?

lofty orchid
#

I suppose we could. It's a nice and complicated use case which you should ignore at the moment in my opinion

thorny vigil
#

Yeah for the first version of the feature I'll ignore it, agreed.

The old app does not support the gamebook stuff at all, so it would already be a huge improvement if the new app supported it at some point, even if we're missing these special comments for a while

thorny vigil
#

@lofty orchid Just FYI: Turns out parsing the treeParts isn't as annoying as I thought, as the hint and deviation comments are all on the mainline by design, so I can get a away with a single loop. So forget that PGN feature request 🙂