fix: restore live watch-order scraping

This commit is contained in:
2026-04-11 22:46:15 +02:00
parent 10321195aa
commit 30d75eeced
11 changed files with 669 additions and 430 deletions

View File

@@ -9,28 +9,21 @@ import (
"time"
"mal/internal/database"
"mal/internal/watchorder"
)
type Client struct {
httpClient *http.Client
baseURL string
db database.Querier
watchOrders *watchorder.Store
mu sync.Mutex
lastReqTime time.Time
}
func NewClient(db database.Querier, watchOrders *watchorder.Store) *Client {
if watchOrders == nil {
watchOrders = watchorder.EmptyStore()
}
func NewClient(db database.Querier) *Client {
return &Client{
httpClient: &http.Client{Timeout: 10 * time.Second},
baseURL: "https://api.jikan.moe/v4",
db: db,
watchOrders: watchOrders,
httpClient: &http.Client{Timeout: 10 * time.Second},
baseURL: "https://api.jikan.moe/v4",
db: db,
}
}