diff --git a/onsen/nuxt/nuxt.go b/onsen/nuxt/nuxt.go index 1f195f6..f62c656 100644 --- a/onsen/nuxt/nuxt.go +++ b/onsen/nuxt/nuxt.go @@ -41,7 +41,7 @@ type Program struct { DirectoryName string `json:"directory_name"` Title string `json:"title"` New bool `json:"new"` - Updated *string `json:"updated"` + Updated interface{} `json:"updated"` Performers []Performer `json:"performers"` Contents []Content `json:"contents"` } diff --git a/onsen/nuxt/nuxt_test.go b/onsen/nuxt/nuxt_test.go index 9eb18c8..17fd7bb 100644 --- a/onsen/nuxt/nuxt_test.go +++ b/onsen/nuxt/nuxt_test.go @@ -50,7 +50,7 @@ func TestCreateWithAnonymousUser(t *testing.T) { {chosen.DirectoryName, "radionyan"}, {chosen.Title, "月とライカと吸血姫 ~アーニャ・シモニャン・ラジオニャン!~"}, {chosen.New, false}, - {*chosen.Updated, "10/22"}, + {chosen.Updated, "10/22"}, {len(chosen.Contents), 6}, { chosen.Performers, @@ -98,7 +98,7 @@ func TestCreateWithLogined(t *testing.T) { {chosen.DirectoryName, "radionyan"}, {chosen.Title, "月とライカと吸血姫 ~アーニャ・シモニャン・ラジオニャン!~"}, {chosen.New, false}, - {*chosen.Updated, "10/22"}, + {chosen.Updated, "10/22"}, {len(chosen.Contents), 6}, // Preimum user can access this content {*chosen.Contents[1].StreamingUrl, "HAS_BEEN_SCREENED"}, diff --git a/onsen/onsen.go b/onsen/onsen.go index 03ae230..0e51f42 100644 --- a/onsen/onsen.go +++ b/onsen/onsen.go @@ -209,7 +209,9 @@ func (r Radio) JstUpdatedAt() (res time.Time, ok bool) { // Fallback for radios with no episodes, using the old logic. if r.Raw.Updated != nil { - return GuessJstTimeWithNow(*r.Raw.Updated) + if s, ok := r.Raw.Updated.(string); ok { + return GuessJstTimeWithNow(s) + } } return time.Time{}, false