diff --git a/Dockerfile b/Dockerfile index 7183ddc..257ad87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN go mod download COPY . . # 指定OS等,并go build -RUN CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long) -X polaris/db.TmdbApiKey=$(echo $TMDB_API_KEY)" ./cmd/ +RUN CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long) -X polaris/db.DefaultTmdbApiKey=$(echo $TMDB_API_KEY)" ./cmd/ FROM debian:stable-slim diff --git a/db/const.go b/db/const.go index e5b1db1..59b7906 100644 --- a/db/const.go +++ b/db/const.go @@ -4,7 +4,7 @@ import "polaris/ent/media" var ( Version = "undefined" - TmdbApiKey = "" + DefaultTmdbApiKey = "" ) const ( diff --git a/db/db.go b/db/db.go index ed807a0..09b601f 100644 --- a/db/db.go +++ b/db/db.go @@ -738,7 +738,7 @@ func (c *Client) SetAcceptedSubtitleFormats(key string, v []string) error { func (c *Client) GetTmdbApiKey() string { k := c.GetSetting(SettingTmdbApiKey) if k == "" { - return TmdbApiKey + return DefaultTmdbApiKey } return k } \ No newline at end of file