package templates import ( "encoding/json" "fmt" "mal/internal/jikan" "mal/internal/shared/ui" "net/url" "strconv" ) // WatchPageData holds the data needed for the watch page type WatchPageData struct { MalID int Title string CurrentEpisode string TotalEpisodes int StartTimeSeconds float64 CurrentStatus string InitialMode string AvailableModes []string ModeSources map[string]ModeSource Segments []SkipSegment } // ModeSource represents a stream source for a specific mode (dub/sub) type ModeSource struct { URL string `json:"url"` Referer string `json:"referer"` Subtitles []SubtitleItem `json:"subtitles"` } // SubtitleItem represents a subtitle track type SubtitleItem struct { Lang string `json:"lang"` URL string `json:"url"` Referer string `json:"referer"` } // SkipSegment represents a skippable segment (intro/outro) type SkipSegment struct { Type string `json:"type"` Start float64 `json:"start"` End float64 `json:"end"` } templ WatchPage(anime jikan.Anime, data WatchPageData) { @Layout(fmt.Sprintf("%s - episode %s", anime.DisplayTitle(), data.CurrentEpisode), true) {
No episodes available
} else {