updated tmdb

This commit is contained in:
2026-01-13 19:11:17 +11:00
parent 7c91cbb08a
commit 1a099a3724
10 changed files with 691 additions and 44 deletions

26
tmdb/api.go Normal file
View File

@@ -0,0 +1,26 @@
package tmdb
import (
"git.haelnorr.com/h/golib/env"
"github.com/pkg/errors"
)
type API struct {
*Config
token string // ENV TMDB_TOKEN: API token for TMDB (required)
}
func NewAPIConnection() (*API, error) {
token := env.String("TMDB_TOKEN", "")
if token == "" {
return nil, errors.New("No TMDB API Token provided")
}
api := &API{
token: token,
}
err := api.getConfig()
if err != nil {
return nil, errors.Wrap(err, "api.getConfig")
}
return api, nil
}