remove dependency on common from mediabrowser

This commit is contained in:
Harvey Tindall
2021-03-29 20:57:13 +01:00
parent 40808bdcb9
commit 1cf8d3037b
6 changed files with 27 additions and 20 deletions
-7
View File
@@ -14,7 +14,6 @@ type Time struct {
}
func (t *Time) UnmarshalJSON(b []byte) (err error) {
// str := strings.TrimSuffix(strings.TrimPrefix(string(b), "\""), "\"")
// Trim quotes from beginning and end, and any number of Zs (indicates UTC).
for b[0] == '"' {
b = b[1:]
@@ -31,12 +30,6 @@ func (t *Time) UnmarshalJSON(b []byte) (err error) {
b = b[:i]
}
t.Time, err = time.Parse("2006-01-02T15:04:05", string(b))
// str := string(b) + "Z"
// timeJSON := []byte("{ \"parseme\": \"" + str + "\" }")
// var parsed magicParse
// // Magically turn it into a time.Time
// err = json.Unmarshal(timeJSON, &parsed)
// t.Time = parsed.Parsed
return
}