Remove ratings from downloaded SGFs

If you can get all the changes sorted on the frontend (which shouldn’t be too bad), I’d imagine anoek might be willing to make corresponding changes in the backend. Worth starting a conversation with him if you’re committed to making this change.

1 Like

I am less of a Javascript/frontend person and more of a backend person, myself. But it looks like there are good libraries for actually generating files fully on the client side. I may look at a full client side solution to remove the dependency on the backend altogether, if there in fact is one currently. May also add a “copy game to clipboard” feature while at it, since many online systems support receiving games by pasting them. That would save the file download/upload roundtrip altogether.

2 Likes

Good luck! I actually implemented the “Paste SGF” feature in OGS, so happy to answer questions if you’re looking at the “Copy SGF” counterpart.

2 Likes

I haven’t looked, but one possible issue: is “Hide ranks” a device setting or an account level setting? If it’s per-device, the API may need to change to tell the server that we don’t want ranks. If it’s at the account level, then the backend will already have this information. Just something to think about.

1 Like

I’m amenable to adding hide_rating as a parameter to the /games/:id:/sgf route on the back end, if

  • Someone wants to do the front end
  • Someone can let me know what is the right thing to do: is it simply drop the BR & WR clauses from the SGF?
4 Likes

I made a little widget. It looks like this

Just download this file:

However, this is not a stand-alone application. You’ll need to install python3 and the requests library.

Requirements:

  1. Install Python3 on your computer. Make sure that you allow “python” to be added to PATH as an environmental variable during installation.
  2. Install the Requests module. Just open a Terminal and type:
    $ python -m pip install requests
  3. Download “Zen SGF Downloader.pyw”. It should be pretty much plug-and-play.
6 Likes

Do you know if it is a functional requirement that the SGF generation be maintained on the server-side? If not, I will investigate moving it solely to the client.

1 Like

A post was merged into an existing topic

Oh, this is much better than function I used (a hacky approach where I just ignore the whole line if it starts with those nodes). Mind if I use this code in my next patch?

2 Likes

Sure, go ahead!

2 Likes

Quick answer: let me dig a bit and come back with a sensible answer :slight_smile:

I’m not ignoring, just getting the whole story :slight_smile:

2 Likes