CXwudi / youcal

Inspired by YouTrack Due Day Calendar, export YouTrack Issue Due to other calendar services (through iCalendar)
MIT License
2 stars 0 forks source link

[Bug] YouTrack API Duration value can be non-standard `P1W` #32

Closed CXwudi closed 5 months ago

CXwudi commented 5 months ago
youcal  | 2024-06-21T03:01:06.650Z  INFO 1 --- [atcher-worker-1] m.cx.yc.core.ical.component.EventMapper  : Start mapping Issue NJK-49 二次元自传博文 (构思)---二次元王国建国录 to VEvent
youcal  | 2024-06-21T03:01:06.651Z  INFO 1 --- [atcher-worker-2] m.cx.yc.core.ical.component.EventMapper  : Start mapping Issue NJK-50 Restore 2024年V家新曲 to VEvent
youcal  | 2024-06-21T03:01:06.663Z  INFO 1 --- [atcher-worker-2] m.c.y.c.i.component.DateTimeFieldSetter  : Mapping to one day VEvent for Issue NJK-50 Restore 2024年V家新曲
youcal  | 2024-06-21T03:01:06.667Z  INFO 1 --- [atcher-worker-2] m.cx.yc.core.ical.component.AlarmMapper  : Try creating VAlarm based on alarm setting for Issue NJK-50 Restore 2024年V家新曲
youcal  | 2024-06-21T03:01:06.667Z  INFO 1 --- [atcher-worker-1] m.c.y.c.i.component.DateTimeFieldSetter  : Mapping to one day VEvent for Issue NJK-49 二次元自传博文 (构思)---二次元王国建国录
youcal  | 2024-06-21T03:01:06.671Z  INFO 1 --- [atcher-worker-1] m.cx.yc.core.ical.component.AlarmMapper  : Try creating VAlarm based on alarm setting for Issue NJK-49 二次元自传博文 (构思)---二次元王国建国录
youcal  | Exception in thread "main" java.time.format.DateTimeParseException: Text cannot be parsed to a Duration
youcal  |       at java.base/java.time.Duration.parse(Duration.java:419)
youcal  |       at mikufan.cx.yc.core.ical.component.AlarmMapper.tryGetDurationFrom(AlarmMapper.kt:97)
youcal  |       at mikufan.cx.yc.core.ical.component.AlarmMapper.tryGetDurationAndDescription(AlarmMapper.kt:60)
youcal  |       at mikufan.cx.yc.core.ical.component.AlarmMapper.createAlarm(AlarmMapper.kt:29)
youcal  |       at mikufan.cx.yc.core.ical.component.EventMapper.doMap(EventMapper.kt:28)
youcal  |       at mikufan.cx.yc.cliapp.component.MainEventMapper.invoke-IoAF18A(MainEventMapper.kt:24)
youcal  |       at mikufan.cx.yc.cliapp.Main$run$1$vEventList$1$1.invokeSuspend(Main.kt:41)
youcal  |       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
youcal  |       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
youcal  |       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
youcal  |       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
youcal  |       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
youcal  |       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
youcal  |       Suppressed: java.time.format.DateTimeParseException: Text cannot be parsed to a Duration
youcal  |               ... 13 more
youcal exited with code 1
Aborting on container exit...

The text is P1W breaks it, it is not standard for Java Duration