Skip to content

fix(onsen): handle numeric 'updated' field from API#4

Merged
Adios merged 1 commit intomainfrom
fix/numeric-delivery-date
Dec 21, 2025
Merged

fix(onsen): handle numeric 'updated' field from API#4
Adios merged 1 commit intomainfrom
fix/numeric-delivery-date

Conversation

@Adios
Copy link
Copy Markdown
Owner

@Adios Adios commented Dec 21, 2025

The Onsen.ag API has started returning numeric values (e.g., 23111) for the 'updated' field in the programs list, which previously only contained date strings (e.g., "10/22") or null. This caused a JSON unmarshaling error because the field was hardcoded as *string.

This change:

  • Updates nuxt.Program.Updated to interface{} to accept both strings and numbers.
  • Safely handles type assertions in onsen.Radio.JstUpdatedAt().
  • Updates associated tests to reflect the change from pointer to interface.

Analysis of current API data suggests that even when 'updated' is numeric and unusable for date parsing, the application can still successfully derive the correct JST update time from episode streaming URLs.

The Onsen.ag API has started returning numeric values (e.g., 23111) for the
'updated' field in the programs list, which previously only contained
date strings (e.g., "10/22") or null. This caused a JSON unmarshaling
error because the field was hardcoded as *string.

This change:
- Updates nuxt.Program.Updated to interface{} to accept both strings and
  numbers.
- Safely handles type assertions in onsen.Radio.JstUpdatedAt().
- Updates associated tests to reflect the change from pointer to interface.

Analysis of current API data suggests that even when 'updated' is numeric
and unusable for date parsing, the application can still successfully
derive the correct JST update time from episode streaming URLs.
@Adios Adios merged commit e29b5ad into main Dec 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant