Skip to content

Commit

Permalink
feat: update fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
wayjam committed Oct 26, 2024
1 parent 82df77d commit 4400f2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type MultiRepoOpt struct {

type MixOpt struct {
SourceName string `mapstructure:"source_name"`
Field string `mapstructure:"field"`
Field string `mapstructure:"field"` // 内部使用,无需配置
Disabled bool `mapstructure:"disabled"` // 是否禁用该字段
}

Expand Down
8 changes: 6 additions & 2 deletions pkg/mixer/mixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ func MixRepo(
if err != nil {
return result, fmt.Errorf("mixing wallpaper: %w", err)
}
result.Wallpaper = wallpaper
if wallpaper != "" {
result.Wallpaper = wallpaper
}
}

// 混合 logo 字段
Expand All @@ -96,7 +98,9 @@ func MixRepo(
if err != nil {
return result, fmt.Errorf("mixing logo: %w", err)
}
result.Logo = logo
if logo != "" {
result.Logo = logo
}
}

// 混合 sites 数组
Expand Down
4 changes: 3 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ type server struct {
}

func NewServer(cfg *config.Config) *server {
app := fiber.New()
app := fiber.New(fiber.Config{
AppName: "TVBox MixProxy",
})

app.Use(recoverer.New())
app.Use(requestid.New())
Expand Down

0 comments on commit 4400f2c

Please sign in to comment.