parent
74fdf1601a
commit
b81c62af15
|
@ -45,6 +45,7 @@ func (u *Match) UnmarshalJSON(data []byte) error {
|
|||
type Alias Match
|
||||
aux := &struct {
|
||||
AudioCodec interface{} `json:"audio_codec,omitempty"`
|
||||
Other interface{} `json:"other,omitempty"`
|
||||
*Alias
|
||||
}{
|
||||
Alias: (*Alias)(u),
|
||||
|
@ -61,6 +62,13 @@ func (u *Match) UnmarshalJSON(data []byte) error {
|
|||
u.AudioCodec = ac
|
||||
}
|
||||
|
||||
switch oth := aux.AudioCodec.(type) {
|
||||
case string:
|
||||
u.AudioCodec = append(u.AudioCodec, oth)
|
||||
case []string:
|
||||
u.AudioCodec = oth
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue