ReadieFur / BSDataPuller

Gathers data about the current map you are playing to then be sent out over a websocket for other software to use, e.g. A web overlay like BSDP-Overlay. This mod works with multi PC setups!
https://github.com/ReadieFur/BeatSaber-Overlay
GNU General Public License v3.0
39 stars 10 forks source link

Improve SongDetails retrieval logic #15

Closed kinsi55 closed 2 years ago

kinsi55 commented 2 years ago

Reuse the same instance after having created one so you dont need to double send data after the first init

Might contain some minor syntax issues, I edited with the GH web editor but logic should be fine

ReadieFur commented 2 years ago

Updated in commit https://github.com/kOFReadie/BSDataPuller/compare/2.0.10...2.0.11

kinsi55 commented 2 years ago

With how you changed the beatSaver.BeatmapByHash(mapHash) call, its on the main thread. This is fine for the SongDetails load because it itself uses a Task.Run() internally but I'm not too sure if BeatmapByHash does that

ReadieFur commented 2 years ago

Interesting, though I don't believe this will be a problem as the data it sets and checks is minimal and shouldn't impact much, though I don't know about the function I'm waiting on itself, how that could affect things. From my quick tests it still seemed fine.