1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2025-02-17 19:39:17 +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; 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({ await prisma.oCMEvent.update({
where:{ where:{
dbId: ocmEventDate.dbId dbId: ocmEventDate.dbId
}, },
data:{ data:{
qualifyingPeriodCloseAt: qualifyingEndTimeStamp qualifyingPeriodCloseAt: changeTime
} }
}) })
} }