@@ -8,7 +8,7 @@ std::string const& Utils::RequestUserAgent = "LevelInfo/" + Mod::get()->getVersi
88std::chrono::seconds const Utils::RequestTimeout = std::chrono::seconds(3 );
99
1010arc::Future<Result<bool , void >> Utils::CheckIfLevelSent (int levelID) {
11- if (!Utils::IsGDPS () && SettingsManager::Other.sendDbApiUrl == " https://api.senddb.dev/api/v1/level/ " ) {
11+ if (!Utils::IsGDPS () && SettingsManager::Other.customSendsEndpoint . empty () ) {
1212 auto req = co_await utils::web::WebRequest ()
1313 .userAgent (Utils::RequestUserAgent)
1414 .timeout (Utils::RequestTimeout)
@@ -17,7 +17,7 @@ arc::Future<Result<bool, void>> Utils::CheckIfLevelSent(int levelID) {
1717 auto body = req.json ().unwrapOrDefault ();
1818 auto error = body[" error" ].asString ().unwrapOrDefault ();
1919
20- if (req.ok () && body.size () > 0 && error.size () <= 0 )
20+ if (req.ok () && body.size () > 0 && error.empty () )
2121 co_return Ok (body[" sent" ].asBool ().unwrap ());
2222 else
2323 log::warn (
@@ -29,7 +29,10 @@ arc::Future<Result<bool, void>> Utils::CheckIfLevelSent(int levelID) {
2929 auto req = co_await utils::web::WebRequest ()
3030 .userAgent (Utils::RequestUserAgent)
3131 .timeout (Utils::RequestTimeout)
32- .get (SettingsManager::Other.sendDbApiUrl + std::to_string (levelID));
32+ .get (SettingsManager::Other.customSendsEndpoint .empty ()
33+ ? " https://api.senddb.dev/api/v1/level/"
34+ : SettingsManager::Other.customSendsEndpoint
35+ + std::to_string (levelID));
3336
3437 auto body = req.json ().unwrapOrDefault ();
3538
0 commit comments