mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-25 20:12:39 +00:00
[maimai2] Avoid playlog saving on first entry session
related: 0cf5039edeb9f2ab208d6326365b88b135c3bcfb
This commit is contained in:
parent
5a64a1ff19
commit
d73e02e327
@ -39,11 +39,20 @@ public class UploadUserPlaylogHandler implements BaseHandler {
|
||||
UploadUserPlaylog uploadUserPlaylog = mapper.convert(request, UploadUserPlaylog.class);
|
||||
|
||||
Optional<UserDetail> userOptional = userDataRepository.findByCard_ExtId(uploadUserPlaylog.getUserId());
|
||||
UserDetail userDetail = userOptional.orElseThrow();
|
||||
|
||||
UserPlaylog userPlaylog = uploadUserPlaylog.getUserPlaylog();
|
||||
userPlaylog.setUser(userDetail);
|
||||
userPlaylogRepository.save(userPlaylog);
|
||||
/*
|
||||
Due to how we handle userId, first user playlog can't be saved.
|
||||
(sequence order swapped, it sends playlog then user detail)
|
||||
It might be possible to fix this with some workaround, but leave it like this at this time.
|
||||
*/
|
||||
if (userOptional.isPresent()) {
|
||||
UserDetail userDetail = userOptional.get();
|
||||
|
||||
UserPlaylog userPlaylog = uploadUserPlaylog.getUserPlaylog();
|
||||
|
||||
userPlaylog.setUser(userDetail);
|
||||
userPlaylogRepository.save(userPlaylog);
|
||||
}
|
||||
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPlaylogApi\"}";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user