Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:29:54 +01:00
1 parent c5d6137fab
commit 4ae7655cd8
223 files changed
+14770 -18352

No files matched your search

+4 -4
View File
@@ -24,7 +24,7 @@ func (err NotFound) Error() string {
}
// Factory is a function that can instantiate a new Player.
type Factory func(config.Player) (Player, error)
type Factory func(*config.Player) (Player, error)
// Detector checks if this player is available.
type Detector func() bool
@@ -65,7 +65,7 @@ func Register(name string, f Factory, d Detector, priority int) {
}
// New returns a player factory for the requested type.
func New(config config.Player) (Player, error) {
func New(config *config.Player) (Player, error) {
log := logrus.WithField("type", config.Type)
log.Trace("create new player")
@@ -83,7 +83,7 @@ func New(config config.Player) (Player, error) {
}
if config.Type == "" || config.Type == "auto" {
log = log.WithField("type", p.Type())
log = log.WithField("type", p.Name())
}
log.Trace("store player instance")
@@ -113,7 +113,7 @@ func Detect() (name string, factory Factory) {
return "", nil
}
func autoDetect(config config.Player) (Player, error) {
func autoDetect(config *config.Player) (Player, error) {
if _, f := Detect(); f != nil {
return f(config)
}