@@ -376,8 +376,19 @@ impl Lesson {
376376 let text = text. replace ( " " , "" ) . trim ( ) . to_string ( ) ;
377377 let text = text. replace ( "bis " , "" ) . trim ( ) . to_string ( ) ;
378378 let text = text. replace ( "um" , "" ) . trim ( ) . to_string ( ) ;
379+ let text = text. replace ( "," , "" ) . trim ( ) . to_string ( ) ;
380+ let text = text. replace ( " den" , "" ) . trim ( ) . to_string ( ) ;
381+ let text = text. replace ( " Uhr" , "" ) . trim ( ) . to_string ( ) ;
382+ let split = text. split ( " " ) ;
383+ let date = format ! (
384+ "{}{}" ,
385+ split. clone( ) . nth( 1 ) . unwrap_or_default( ) ,
386+ chrono:: Local :: now( ) . year( ) ,
387+ ) ;
388+ let time = format ! ( "{}:00" , split. last( ) . unwrap_or_default( ) ) ;
389+ println ! ( "text is: {}" , text) ;
379390
380- date_time_string_to_datetime ( text . as_str ( ) , "02:00:00" )
391+ date_time_string_to_datetime ( date . as_str ( ) , time . as_str ( ) )
381392 . map_err ( |e| {
382393 Error :: DateTime ( format ! (
383394 "failed to convert date to DateTime '{:?}'" ,
@@ -1383,6 +1394,9 @@ pub async fn get_lessons(account: &Account) -> Result<Vec<Lesson>, Error> {
13831394 let topic_title =
13841395 collect_text ( school_class. select ( & topic_title_selector) . next ( ) )
13851396 . unwrap_or ( "" . to_string ( ) ) ;
1397+ if topic_title. is_empty ( ) {
1398+ continue ;
1399+ }
13861400
13871401 let teacher_short_selector = Selector :: parse (
13881402 ".teacher .btn.btn-primary.dropdown-toggle.btn-xs" ,
0 commit comments