diff --git a/internal/jikan/types.go b/internal/jikan/types.go index bc3a533..5d608ce 100644 --- a/internal/jikan/types.go +++ b/internal/jikan/types.go @@ -40,22 +40,36 @@ type Anime struct { LargeImageURL string `json:"large_image_url"` } `json:"webp"` } `json:"images"` - Synopsis string `json:"synopsis"` - Score float64 `json:"score"` - ScoredBy int `json:"scored_by"` - Rank int `json:"rank"` - Popularity int `json:"popularity"` - Status string `json:"status"` - Episodes int `json:"episodes"` - Season string `json:"season"` - Year int `json:"year"` - Type string `json:"type"` - Rating string `json:"rating"` - Duration string `json:"duration"` - Aired Aired `json:"aired"` - Genres []NamedEntity `json:"genres"` - Studios []NamedEntity `json:"studios"` - Producers []NamedEntity `json:"producers"` + Synopsis string `json:"synopsis"` + Score float64 `json:"score"` + ScoredBy int `json:"scored_by"` + Rank int `json:"rank"` + Popularity int `json:"popularity"` + Status string `json:"status"` + Episodes int `json:"episodes"` + Season string `json:"season"` + Year int `json:"year"` + Type string `json:"type"` + Rating string `json:"rating"` + Duration string `json:"duration"` + Aired Aired `json:"aired"` + Genres []NamedEntity `json:"genres"` + Studios []NamedEntity `json:"studios"` + Producers []NamedEntity `json:"producers"` + Themes []NamedEntity `json:"themes"` + Themes2 []NamedEntity `json:"themes"` // fallback for different API versions + Source string `json:"source"` + Demographics []NamedEntity `json:"demographics"` + Broadcast struct { + Day string `json:"day"` + Time string `json:"time"` + Timezone string `json:"timezone"` + String string `json:"string"` + } `json:"broadcast"` + Streaming []struct { + Name string `json:"name"` + URL string `json:"url"` + } `json:"streaming"` } // ImageURL returns the webp large image URL diff --git a/internal/templates/anime.templ b/internal/templates/anime.templ index 653bcde..c822256 100644 --- a/internal/templates/anime.templ +++ b/internal/templates/anime.templ @@ -116,12 +116,54 @@ templ AnimeDetails(anime jikan.Anime, currentStatus string) { } - if len(anime.Producers) > 0 { -
") + if anime.Source != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if len(anime.Demographics) > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if len(anime.Themes) > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if anime.Broadcast.String != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if len(anime.Streaming) > 0 { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -493,36 +631,36 @@ func WatchlistDropdown(animeID int, animeTitle string, animeTitleEnglish string, }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var23 := templ.GetChildren(ctx) - if templ_7745c5c3_Var23 == nil { - templ_7745c5c3_Var23 = templ.NopComponent + templ_7745c5c3_Var29 := templ.GetChildren(ctx) + if templ_7745c5c3_Var29 == nil { + templ_7745c5c3_Var29 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -589,66 +727,66 @@ func dropdownStatusOption(animeID int, animeTitle string, animeTitleEnglish stri }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var26 := templ.GetChildren(ctx) - if templ_7745c5c3_Var26 == nil { - templ_7745c5c3_Var26 = templ.NopComponent + templ_7745c5c3_Var32 := templ.GetChildren(ctx) + if templ_7745c5c3_Var32 == nil { + templ_7745c5c3_Var32 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - var templ_7745c5c3_Var27 = []any{"dropdown-item", templ.KV("active", status == currentStatus)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) + var templ_7745c5c3_Var33 = []any{"dropdown-item", templ.KV("active", status == currentStatus)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var33...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "