Add TheRun.gg Integration#70
Conversation
|
Hey! I tried compiling your repo with "cargo build --release" and copied over the .so file to my OBS, yet I do not see this part of the UI. I'd love to use this feature, but for some reason it's not working. Maybe the latest version of OBS-Studio that released a couple days ago is messing with something? |
`livesplit-core` was recently updated to provide a `therun_gg::Client` obkect that sends live split data and uploads .lss files to therun.gg. This functionality has been integrated with the web version of LiveSplit One, but not this OBS plugin. This patch adds the necessary infrastructure to send timer events to therun.gg. Because the `therun_gg::Client` uses `reqwest`, we initialize its required tokio runtime at module load and share it across all timer instances. Each InnerTimer now holds a `therun_gg_client` that receives events from every `CommandSink` method, spawning async work on that tokio runtime. In this patch, we default the client to an empty API key so it won't communicate with therun.gg. A subsequent patch will introduce the OBS settings integration.
The previous patch hooks up the infastructure for therun.gg integration, but it leaves settings hard-coded. We want users to be able to configure these settings from the OBS source properties dialog. This patch adds the settings UI for therun.gg integration, allowing users to set their API key, whether to track live runs, and whether to upload stats automatically. These settings are configurable in a group that also includes a button to open the page on the therun.gg website where users can retrieve their API key. The structure of this patch is meant to match closely the way autosplitter settings are fed from the UI back into the timer. In particular, when settings are updated in the UI, a new `therun_gg::Client` is created with the new API key and settings.
Please make sure you're building against the branch in this pull request, which has the is all you need to do before installing. |
|
@CryZe Could you take a look at this? It follows closely the other therun.gg integrations. I've been using it for a few months on my own streams, and would love for it to be built in the official Flatpak. |
This pull request adds integration with TheRun.gg to the OBS plugin for LiveSplit One, following the changes in LiveSplit/livesplit-core#903 and LiveSplit/LiveSplitOne#1128. Most of the work required in this PR making sure the TheRun.gg client and the tokio runtime it (via reqwest) requires are set up correctly, and managing the settings UI. I've manually tested these changes with my own TheRun.gg key to make sure that splits are properly tracked.
This is how the settings UI looks now:
I took the localizations from the LiveSplitOne web UI PR linked above, except for the
TheRunGetApiKey/"Get Upload Key` string, which I used an LLM to translate into each supported language. Spot checking the languages I'm familiar with, it looks reasonable. I would appreciate native speaker input though.Please see the commit messages for each patch in this pull request for more details.