diff --git a/api/playback/handler.go b/api/playback/handler.go index 3eb88fa..62aab1b 100644 --- a/api/playback/handler.go +++ b/api/playback/handler.go @@ -80,7 +80,7 @@ func (h *Handler) HandleWatchPage(w http.ResponseWriter, r *http.Request) { } // resolve current episode: query param > saved progress > first episode -currentEpID := r.URL.Query().Get("ep") + currentEpID := r.URL.Query().Get("ep") if currentEpID == "" { if user != nil { entry, err := h.svc.db.GetWatchListEntry(r.Context(), db.GetWatchListEntryParams{ diff --git a/api/playback/service_base.go b/api/playback/service_base.go index 5001b87..408027f 100644 --- a/api/playback/service_base.go +++ b/api/playback/service_base.go @@ -325,9 +325,9 @@ func (s *Service) fetchPlaybackSourcesAndSegments(ctx context.Context, showID st segmentsCh <- s.fetchSkipSegments(ctx, malID, episode) }() -modeSources := make(map[string]ModeSource) - // collect results from both mode goroutines - for range 2 { + modeSources := make(map[string]ModeSource) + // collect results from both mode goroutines + for range 2 { result := <-modeCh if !result.OK { continue diff --git a/integrations/jikan/client.go b/integrations/jikan/client.go index 6c287a4..db778cc 100644 --- a/integrations/jikan/client.go +++ b/integrations/jikan/client.go @@ -22,7 +22,7 @@ type Client struct { db db.Querier retrySignal chan struct{} // signals retry worker to process queued retries mu sync.Mutex - lastReqTime time.Time // rate limiting: last request timestamp + lastReqTime time.Time // rate limiting: last request timestamp } func NewClient(db db.Querier) *Client { diff --git a/integrations/jikan/constants.go b/integrations/jikan/constants.go index a95f804..d271d5c 100644 --- a/integrations/jikan/constants.go +++ b/integrations/jikan/constants.go @@ -2,5 +2,5 @@ package jikan import "time" -const shortCacheTTL = time.Hour // 1 hour - for frequently changing data -const longCacheTTL = time.Hour * 24 // 24 hours - for stable data like genres +const shortCacheTTL = time.Hour // 1 hour - for frequently changing data +const longCacheTTL = time.Hour * 24 // 24 hours - for stable data like genres diff --git a/integrations/watchorder/watch_order.go b/integrations/watchorder/watch_order.go index c4df5e4..9a000e5 100644 --- a/integrations/watchorder/watch_order.go +++ b/integrations/watchorder/watch_order.go @@ -17,6 +17,7 @@ const defaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/ // idPattern extracts the watch order ID from chiaki.site URLs var idPattern = regexp.MustCompile(`/id/(\d+)`) + // malLinkPattern extracts MAL IDs from watch order entries var malLinkPattern = regexp.MustCompile(`myanimelist\.net/anime/(\d+)`) @@ -48,9 +49,9 @@ func (e *HTTPStatusError) Error() string { } type WatchOrderEntry struct { - ID int `json:"id"` // MAL anime ID - Type string `json:"type"` // anime type label (e.g. "TV", "Movie") - Title string `json:"title"` // primary title + ID int `json:"id"` // MAL anime ID + Type string `json:"type"` // anime type label (e.g. "TV", "Movie") + Title string `json:"title"` // primary title TitleAlt string `json:"title_alt,omitempty"` // alternative title } diff --git a/internal/middleware/access.go b/internal/middleware/access.go index 58cefb2..d86c1e1 100644 --- a/internal/middleware/access.go +++ b/internal/middleware/access.go @@ -7,7 +7,7 @@ import ( type AccessPolicy struct { PublicPaths map[string]struct{} // exact match paths (e.g. /login) - PublicHeads []string // prefix match paths (e.g. /static/) + PublicHeads []string // prefix match paths (e.g. /static/) } func NewAccessPolicy() AccessPolicy { @@ -17,7 +17,7 @@ func NewAccessPolicy() AccessPolicy { }, PublicHeads: []string{ "/static/", // static assets - "/dist/", // bundled assets + "/dist/", // bundled assets }, } }