]> code.octet-stream.net Git - broadcaster/blobdiff - radio/main.go
Handle timestamps with no seconds cleanly
[broadcaster] / radio / main.go
index 22658a38633fab0219c54e1fee37a80c4e44e95f..85d15b1d715e6046b60dd1366da574acbf8ff15e 100644 (file)
@@ -227,7 +227,10 @@ func playlistWorker(ch <-chan []protocol.PlaylistSpec, stop <-chan bool) {
                        }
                        var soonestTime time.Time
                        for _, v := range specs {
-                               t, err := time.ParseInLocation(protocol.StartTimeFormat, v.StartTime, loc)
+                               t, err := time.ParseInLocation(protocol.StartTimeFormatSecs, v.StartTime, loc)
+                               if err != nil {
+                                       t, err = time.ParseInLocation(protocol.StartTimeFormat, v.StartTime, loc)
+                               }
                                if err != nil {
                                        log.Println("Error parsing start time", err)
                                        continue