Skip to content

Commit

Permalink
Only initialize Schedules Direct if configured. Fixes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Aug 20, 2018
1 parent fdcaa93 commit 309792d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.0.1
12 changes: 7 additions & 5 deletions lineup.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ func newLineup() *lineup {
channels: make(map[int]hdHomeRunLineupItem),
}

sdClient, sdClientErr := schedulesdirect.NewClient(viper.GetString("schedulesdirect.username"), viper.GetString("schedulesdirect.password"))
if sdClientErr != nil {
log.WithError(sdClientErr).Panicln("error setting up schedules direct client")
}
if viper.IsSet("schedulesdirect.username") && viper.IsSet("schedulesdirect.password") {
sdClient, sdClientErr := schedulesdirect.NewClient(viper.GetString("schedulesdirect.username"), viper.GetString("schedulesdirect.password"))
if sdClientErr != nil {
log.WithError(sdClientErr).Panicln("error setting up schedules direct client")
}

lineup.sd = sdClient
lineup.sd = sdClient
}

for _, cfg := range cfgs {
provider, providerErr := cfg.GetProvider()
Expand Down

0 comments on commit 309792d

Please sign in to comment.