@@ -390,7 +390,6 @@ func getSessionNodes(event eventStruct) []*tview.TreeNode {
390390 allIDs = append (allIDs , idList ... )
391391 }
392392 if len (allIDs ) > 0 {
393- debugPrint ("has bonus" )
394393 bonusNode := tview .NewTreeNode ("Bonus Content" ).SetSelectable (true ).SetExpanded (false ).SetReference ("bonus" )
395394 addEpisodes (bonusNode , allIDs )
396395 return append (sessions , bonusNode )
@@ -613,38 +612,11 @@ func switchNode(node *tview.TreeNode) {
613612 if index , ok := reference .(int ); ok && index < len (vodTypes .Objects ) {
614613 v , t := getTableValuesFromInterface (vodTypes .Objects [index ])
615614 go fillTableFromSlices (v , t , abortWritingInfo )
616- } else if event , ok := reference .(eventStruct ); ok {
617- v , t := getTableValuesFromInterface (event )
618- go fillTableFromSlices (v , t , abortWritingInfo )
619- } else if season , ok := reference .(seasonStruct ); ok {
620- v , t := getTableValuesFromInterface (season )
621- go fillTableFromSlices (v , t , abortWritingInfo )
622- } else if session , ok := reference .(sessionStreamsStruct ); ok {
623- v , t := getTableValuesFromInterface (session )
624- go fillTableFromSlices (v , t , abortWritingInfo )
625- } else if channel , ok := reference .(channelUrlsStruct ); ok {
626- v , t := getTableValuesFromInterface (channel )
627- go fillTableFromSlices (v , t , abortWritingInfo )
628- } else if seasons , ok := reference .(allSeasonStruct ); ok {
629- v , t := getTableValuesFromInterface (seasons )
630- go fillTableFromSlices (v , t , abortWritingInfo )
631- } else if ep , ok := reference .(episodeStruct ); ok {
632- //get name and value
633- titles := make ([]string , 1 )
634- values := make ([][]string , 1 )
635- titles = append (titles , "Title" )
636- values = append (values , []string {ep .Title })
637- titles = append (titles , "Subtitle" )
638- values = append (values , []string {ep .Subtitle })
639- titles = append (titles , "Synopsis" )
640- values = append (values , []string {ep .Synopsis })
641- titles = append (titles , "Drivers" )
642- values = append (values , ep .DriverUrls )
643- titles = append (titles , "Teams" )
644- values = append (values , ep .TeamUrls )
645- go fillTableFromSlices (titles , values , abortWritingInfo )
646615 } else if len (node .GetChildren ()) != 0 {
647616 infoTable .Clear ()
617+ } else if x := reflect .ValueOf (reference ); x .Kind () == reflect .Struct {
618+ v , t := getTableValuesFromInterface (reference )
619+ go fillTableFromSlices (v , t , abortWritingInfo )
648620 }
649621 infoTable .ScrollToBeginning ()
650622}
0 commit comments