1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2024-11-28 01:11:00 +01:00

add gap between qualifying and main draw if the gap is less than 1 hour

This commit is contained in:
ghkkk090 2022-08-20 12:24:18 +07:00
parent eec96bd011
commit d65c0503f0

View File

@ -103,15 +103,17 @@ export default class GhostModule extends Module {
competitionPeriodStartTimestamp = competitionPeriodEndTimeStamp + ocmEventDate.lengthOfInterval;
}
if(ocmEventDate.lengthOfInterval !== 0)
// Check the gap between quali close and main draw start timestamp
let checkQualiMainGap = ocmEventDate.competitionStartAt - ocmEventDate.qualifyingPeriodCloseAt;
if(checkQualiMainGap < 3600)
{
let qualifyingEndTimeStamp = ocmEventDate.qualifyingPeriodCloseAt - ocmEventDate.lengthOfInterval
let changeTime = ocmEventDate.competitionStartAt - 3600;
await prisma.oCMEvent.update({
where:{
dbId: ocmEventDate.dbId
},
data:{
qualifyingPeriodCloseAt: qualifyingEndTimeStamp
qualifyingPeriodCloseAt: changeTime
}
})
}