mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
Simplify population logic and match code style
This commit is contained in:
parent
09bfca4e4a
commit
4f009419b8
@ -8,7 +8,6 @@ using System.Threading;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Models;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.IO.Archives;
|
using osu.Game.IO.Archives;
|
||||||
@ -80,19 +79,12 @@ namespace osu.Game.Scoring
|
|||||||
{
|
{
|
||||||
base.PostImport(model, realm);
|
base.PostImport(model, realm);
|
||||||
|
|
||||||
var userRequest = new GetUserRequest(model.User.Username);
|
var userRequest = new GetUserRequest(model.RealmUser.Username);
|
||||||
api.Perform(userRequest);
|
|
||||||
APIUser userReq = userRequest.Response;
|
|
||||||
|
|
||||||
if (!(userReq is null)) {
|
api.Perform(userRequest);
|
||||||
Logger.Log($"Assignning UserID to RealmUser");
|
|
||||||
var user = new RealmUser
|
if (userRequest.Response is APIUser user)
|
||||||
{
|
model.RealmUser.OnlineID = user.Id;
|
||||||
OnlineID = userReq.Id,
|
|
||||||
Username = model.User.Username
|
|
||||||
};
|
|
||||||
model.RealmUser = user;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user