diff --git a/cgvAjax.js b/cgvAjax.js index 2c910c5..6f43d54 100644 --- a/cgvAjax.js +++ b/cgvAjax.js @@ -246,6 +246,14 @@ class cgvGetter { const t_end = moment(tmRange.end, 'HHmm'); return scheduleTm.isBetween(t_start, t_end, null, '[]'); }) + + //시트 없거나 적합한 시간 없을 시 디버깅용 + if(seatFilteredSchedule.length === 0) { + __ERROR__(`ScheduleList is empty: ${JSON.stringify(scheduleList)}`); + } else if(tmFilteredSchedule.length === 0) { + __ERROR__(`PlayStartTm doesn't meet the condition: ${seatFilteredSchedule.map(schedule => schedule.PlayStartTm)}`); + } + if (tmFilteredSchedule.length !== 0) { targetSchedule = tmFilteredSchedule[0]; await __INFO__(`조건 부합 스케줄 식별됨 - 시도: ${++attemptCnt} / 시간: ${moment().format('MM-DD HH:mm:ss')} / 경과: ${init.fromNow()}`); @@ -533,7 +541,7 @@ await (async () => { /*====== Dev Mode ======*/ case 1: - const result = await CGV.main_dev('20035290', null, moment('2024-03-23', 'YYYY-MM-DD')); // '20035290', null, moment('2024-03-09', 'YYYY-MM-DD' //// '20035479', null, moment('2024-02-16', 'YYYY-MM-DD' + const result = await CGV.main_dev('20035290', null, moment('2024-04-05', 'YYYY-MM-DD')); // '20035290', null, moment('2024-03-09', 'YYYY-MM-DD' //// '20035479', null, moment('2024-02-16', 'YYYY-MM-DD' if (result === -1) await __ERROR__('예매에 실패했습니다!'); else if (result === 1) await __INFO__(`예매에 성공했습니다!`); break diff --git a/src/utils/commonUtil.js b/src/utils/commonUtil.js index 9149503..a8dada7 100644 --- a/src/utils/commonUtil.js +++ b/src/utils/commonUtil.js @@ -17,8 +17,8 @@ const YMDConvert = (YYMMDD, format = 'YYYYMMDD') => { const dayFilter = (dates) => { return dates.filter(date => { const day = date.day(); - // return day === 6 || day === 1; - day === 1; + return day === 6 || day === 0; // 주말 + // return day === 0; // 일 // sunday: 0 ~ saturday: 6 }); }