chore: fix whitespace

This commit is contained in:
2026-05-02 13:51:36 +02:00
committed by Mikkel Elvers
parent 33b450a686
commit 94e60e0d8b
4 changed files with 15 additions and 15 deletions

View File

@@ -199,15 +199,15 @@ func (h *Handler) HandleEpisodeData(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]any{
"mal_id": watchData.MalID,
"title": watchData.Title,
"current_episode": watchData.CurrentEpisode,
"total_episodes": anime.Episodes,
"initial_mode": watchData.InitialMode,
"token": "", // The token might be per-source, wait, in Go it was per-mode?
"available_modes": watchData.AvailableModes,
"mode_sources": watchData.ModeSources,
"segments": watchData.Segments,
"episode_title": "", // Find episode title if possible
"mal_id": watchData.MalID,
"title": watchData.Title,
"current_episode": watchData.CurrentEpisode,
"total_episodes": anime.Episodes,
"initial_mode": watchData.InitialMode,
"token": "", // The token might be per-source, wait, in Go it was per-mode?
"available_modes": watchData.AvailableModes,
"mode_sources": watchData.ModeSources,
"segments": watchData.Segments,
"episode_title": "", // Find episode title if possible
})
}

View File

@@ -57,7 +57,7 @@ func RequireAuth(next http.Handler) http.Handler {
r = r.WithContext(ctx)
}
}
user, ok := r.Context().Value(ctxpkg.UserKey).(*database.User)
if !ok || user == nil {
if strings.HasPrefix(r.URL.Path, "/api/") {

View File

@@ -52,7 +52,7 @@ func NewRouter(cfg Config) http.Handler {
middleware.InitAuth(cfg.AuthService)
animeHandler := anime.NewHandler(cfg.JikanClient, cfg.DB)
playbackSvc := playback.NewService(cfg.DB, cfg.SQLDB, playback.Config{
ProxyTokenSecret: cfg.PlaybackProxySecret,
})

View File

@@ -24,7 +24,7 @@ func GetRenderer() *Renderer {
renderer = &Renderer{
templates: make(map[string]*template.Template),
}
funcs := template.FuncMap{
"dict": func(values ...any) map[string]any {
m := make(map[string]any)
@@ -62,12 +62,12 @@ func GetRenderer() *Renderer {
tmpl := template.New(name).Funcs(funcs)
// Parse base first so it establishes the core definitions
tmpl = template.Must(tmpl.ParseFiles(filepath.Join(".", "templates", "base.gohtml")))
// Parse all components next so they are available to the page
if len(components) > 0 {
tmpl = template.Must(tmpl.ParseFiles(components...))
}
// Parse the page itself last
tmpl = template.Must(tmpl.ParseFiles(page))