mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Use ffmpeg
extractor by default on Windows
This is to avoid issue with unicode chars in filenames. See #810
This commit is contained in:
parent
d3975d206a
commit
4ed01bad86
4 changed files with 23 additions and 13 deletions
|
@ -214,7 +214,7 @@ func init() {
|
|||
viper.SetDefault("reverseproxyuserheader", "Remote-User")
|
||||
viper.SetDefault("reverseproxywhitelist", "")
|
||||
|
||||
viper.SetDefault("scanner.extractor", "taglib")
|
||||
viper.SetDefault("scanner.extractor", DefaultScannerExtractor)
|
||||
viper.SetDefault("scanner.genreseparators", ";/,")
|
||||
|
||||
viper.SetDefault("agents", "lastfm,spotify")
|
||||
|
|
5
conf/defaults.go
Normal file
5
conf/defaults.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
// +build !windows
|
||||
|
||||
package conf
|
||||
|
||||
const DefaultScannerExtractor = "taglib"
|
5
conf/defaults_win.go
Normal file
5
conf/defaults_win.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
// +build windows
|
||||
|
||||
package conf
|
||||
|
||||
const DefaultScannerExtractor = "ffmpeg"
|
|
@ -23,20 +23,20 @@ type Parser interface {
|
|||
Parse(files ...string) (map[string]map[string][]string, error)
|
||||
}
|
||||
|
||||
func Extract(files ...string) (map[string]*Tags, error) {
|
||||
var e Parser
|
||||
var parsers = map[string]Parser{
|
||||
"ffmpeg": &ffmpeg.Parser{},
|
||||
"taglib": &taglib.Parser{},
|
||||
}
|
||||
|
||||
switch conf.Server.Scanner.Extractor {
|
||||
case "taglib":
|
||||
e = &taglib.Parser{}
|
||||
case "ffmpeg":
|
||||
e = &ffmpeg.Parser{}
|
||||
default:
|
||||
log.Warn("Invalid 'Scanner.Extractor' option. Using default 'taglib'", "requested", conf.Server.Scanner.Extractor,
|
||||
"validOptions", "ffmpeg,taglib")
|
||||
e = &taglib.Parser{}
|
||||
func Extract(files ...string) (map[string]*Tags, error) {
|
||||
p, ok := parsers[conf.Server.Scanner.Extractor]
|
||||
if !ok {
|
||||
log.Warn("Invalid 'Scanner.Extractor' option. Using default", "requested", conf.Server.Scanner.Extractor,
|
||||
"validOptions", "ffmpeg,taglib", "default", conf.DefaultScannerExtractor)
|
||||
p = parsers[conf.DefaultScannerExtractor]
|
||||
}
|
||||
extractedTags, err := e.Parse(files...)
|
||||
|
||||
extractedTags, err := p.Parse(files...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue