@@ -33,7 +33,8 @@ export const CODEURS_EN_SEINE_PARSER = EVENT_DESCRIPTOR_PARSER.omit({
3333 } )
3434 } ) ) ,
3535 // the old one was: https://www.codeursenseine.com/_ipx/w_256,q_75/%2Fimages%2Fspeakers%2F{speakerImage}
36- speakerPictureTemplate : z . string ( ) . default ( `https://www.codeursenseine.com/_next/image?url=%2Fimages%2Fspeakers%2F{speakerImage}&w=256&q=75` )
36+ speakerPictureTemplate : z . string ( ) . default ( `https://www.codeursenseine.com/_next/image?url=%2Fimages%2Fspeakers%2F{speakerImage}&w=256&q=75` ) ,
37+ unknownSpeakerIds : z . array ( z . string ( ) ) . optional ( ) . default ( [ ] ) ,
3738} )
3839
3940function extractIdFromUrl ( url : string ) {
@@ -112,9 +113,12 @@ export const CODEURS_EN_SEINE_CRAWLER: CrawlerKind<typeof CODEURS_EN_SEINE_PARSE
112113 await githubMDXCrawler . crawlDirectory ( "content/talks" , ( mdxFile , fileEntry ) => {
113114 const fileMetadata = mdxFile . metadata as CESTalkMDXData ;
114115
115- const start = `${ fileMetadata . start } +02:00` as ISODatetime
116- const end = `${ fileMetadata . end } +02:00` as ISODatetime
116+ const startZDT = Temporal . PlainDateTime . from ( fileMetadata . start ) . toZonedDateTime ( descriptor . timezone )
117+ const endZDT = Temporal . PlainDateTime . from ( fileMetadata . end ) . toZonedDateTime ( descriptor . timezone )
118+ const start = startZDT . toInstant ( ) . toString ( ) as ISODatetime
119+ const end = endZDT . toInstant ( ) . toString ( ) as ISODatetime
117120 const duration = durationFrom ( start , end , descriptor ) ;
121+ const talkId = fileEntry . name . substring ( 0 , fileEntry . name . length - ".mdx" . length ) ;
118122
119123 return match ( [ fileMetadata ] )
120124 . with ( [ { kind : P . union ( "conference" , "quicky" , "atelier" , "sponsor" , "pleniere" , "keynote" ) } ] , ( [ talkMetadata ] ) => {
@@ -133,10 +137,24 @@ export const CODEURS_EN_SEINE_CRAWLER: CrawlerKind<typeof CODEURS_EN_SEINE_PARSE
133137 return undefined ;
134138 }
135139
136- const speaker = fetchedSpeakers . find ( sp => sp . id === speakerId )
137- if ( ! speaker ) {
138- throw new Error ( `No speaker found in fetched speakers with id: ${ speakerId } !` ) ;
139- }
140+ const speaker = match ( fetchedSpeakers . find ( sp => sp . id === speakerId ) )
141+ . with ( P . nullish , ( ) => {
142+ if ( descriptor . unknownSpeakerIds . includes ( speakerId ) ) {
143+ const unknownSpeaker : Speaker = {
144+ id : speakerId ,
145+ fullName : "Speaker inconnu" ,
146+ companyName : null ,
147+ bio : null ,
148+ social : [ ] ,
149+ photoUrl : null ,
150+ }
151+ return unknownSpeaker ;
152+ }
153+
154+ throw new Error ( `No speaker found in fetched speakers with id: ${ speakerId } ! (context: talkId=${ talkId } )` ) ;
155+ } )
156+ . otherwise ( speaker => speaker )
157+
140158 return speaker ;
141159 } ) . filter ( sp => ! ! sp ) . map ( sp => sp ! ) ;
142160
@@ -149,8 +167,8 @@ export const CODEURS_EN_SEINE_CRAWLER: CrawlerKind<typeof CODEURS_EN_SEINE_PARSE
149167 talkFormats . push ( format ) ;
150168 }
151169
152- const talkDetails : DetailedTalk = {
153- id : fileEntry . name . substring ( 0 , fileEntry . name . length - ".mdx" . length ) ,
170+ const talkDetails : DetailedTalk = {
171+ id : talkId ,
154172 start, end,
155173 speakers,
156174 summary : mdxFile . content ,
0 commit comments