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