ion232 / lichess-api

A Rust API client for lichess.org
https://lichess.org/api
Apache License 2.0
9 stars 7 forks source link

Add support for importing PGN into study #53

Closed yzoug closed 5 months ago

yzoug commented 7 months ago

This PR adds the ability to send a PGN into a study (this endpoint).

I tested this (all chapters in this study are imported using this code) with no issues.

I have begun work to implement the whole Studies API endpoint. However, the output of the Lichess API is very messy: we need to parse a non-standard data format (application/chess-x-pgn). You can see my first try in this PR (not mergeable).

Will maybe continue working on this but I think it won't be the most used feature of the Lichess API: it's way easier to consult studies directly on the Lichess interface. However, sending a PGN into a study is something more people would want to do (at least, I will need this for my project).

If someone wants to give it a go to implement the rest of the Studies API endpoint I can help! But as you can see in the linked PR above, it's a mess :/

yzoug commented 7 months ago

PS: if merged, the issue https://github.com/ion232/lichess-api/issues/26 can be updated to reflect that this endpoint is supported

ion232 commented 5 months ago

Sorry for the late review - thanks for the changes.