From b81c62af15300da5f6b9735e5f86d09d80185d36 Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Fri, 11 Aug 2023 18:51:40 +0200 Subject: [PATCH] Support Other fully. --- guessit.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guessit.go b/guessit.go index a9a6fe2..2903527 100644 --- a/guessit.go +++ b/guessit.go @@ -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 }