File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,12 +313,11 @@ impl SheetResult {
313313 . ok_or_else ( || anyhow:: format_err!( "No Translations" ) ) ?;
314314 let image_source = values
315315 . next ( )
316- . ok_or_else ( || anyhow:: format_err!( "Missing image source" ) ) ?
316+ . ok_or_else ( || anyhow:: format_err!( "Missing image source row " ) ) ?
317317 . into_iter ( )
318318 . skip ( 1 )
319319 . next ( )
320- . unwrap ( )
321- . to_ascii_lowercase ( ) ;
320+ . map ( |src| src. to_ascii_lowercase ( ) ) ;
322321 let image_ids = values
323322 . next ( )
324323 // Remove the row title.
@@ -364,10 +363,12 @@ impl SheetResult {
364363 . await ?
365364 . into_translation ( ) ,
366365 ) ,
367- page_images : image_ids. map ( |ids| dailp:: IiifImages {
368- source : dailp:: ImageSourceId ( image_source) ,
369- ids,
370- } ) ,
366+ page_images : if let ( Some ( ids) , Some ( source) ) = ( image_ids, image_source) {
367+ Some ( dailp:: IiifImages {
368+ source : dailp:: ImageSourceId ( source) ,
369+ ids,
370+ } )
371+ } else { None } ,
371372 date : date
372373 . get ( 1 )
373374 . and_then ( |s| chrono:: NaiveDate :: parse_from_str ( s, "%Y-%m-%d" ) . ok ( ) )
You can’t perform that action at this time.
0 commit comments