"strings"
"time"
+ "code.octet-stream.net/broadcaster/internal/protocol"
"golang.org/x/crypto/bcrypt"
"golang.org/x/net/websocket"
)
const version = "v1.1.0"
-const formatString = "2006-01-02T15:04:05"
//go:embed templates/*
var content embed.FS
if id == 0 {
data.Playlist.Enabled = true
data.Playlist.Name = "New Playlist"
- data.Playlist.StartTime = time.Now().Format(formatString)
+ data.Playlist.StartTime = time.Now().Format(protocol.StartTimeFormatSecs)
data.Entries = append(data.Entries, PlaylistEntry{})
} else {
playlist, err := db.GetPlaylist(id)
if err != nil {
return
}
- _, err = time.Parse(formatString, r.Form.Get("playlistStartTime"))
+ _, err = time.Parse(protocol.StartTimeFormatSecs, r.Form.Get("playlistStartTime"))
+ if err != nil {
+ _, err = time.Parse(protocol.StartTimeFormat, r.Form.Get("playlistStartTime"))
+ }
if err != nil {
return
}