mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Add config option to select tag extractor (taglib, ffmpeg)
This commit is contained in:
parent
506899b083
commit
34eda3c8fc
2 changed files with 24 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/log"
|
||||
)
|
||||
|
||||
|
@ -17,7 +18,18 @@ type Extractor interface {
|
|||
}
|
||||
|
||||
func Extract(files ...string) (map[string]Metadata, error) {
|
||||
e := &taglibExtractor{}
|
||||
var e Extractor
|
||||
|
||||
switch conf.Server.Scanner.Extractor {
|
||||
case "taglib":
|
||||
e = &taglibExtractor{}
|
||||
case "ffmpeg":
|
||||
e = &ffmpegExtractor{}
|
||||
default:
|
||||
log.Warn("Invalid Scanner.Extractor option. Using default ffmpeg", "requested", conf.Server.Scanner.Extractor,
|
||||
"validOptions", "ffmpeg,taglib")
|
||||
e = &ffmpegExtractor{}
|
||||
}
|
||||
return e.Extract(files...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue