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("reverseproxyuserheader", "Remote-User")
|
||||||
viper.SetDefault("reverseproxywhitelist", "")
|
viper.SetDefault("reverseproxywhitelist", "")
|
||||||
|
|
||||||
viper.SetDefault("scanner.extractor", "taglib")
|
viper.SetDefault("scanner.extractor", DefaultScannerExtractor)
|
||||||
viper.SetDefault("scanner.genreseparators", ";/,")
|
viper.SetDefault("scanner.genreseparators", ";/,")
|
||||||
|
|
||||||
viper.SetDefault("agents", "lastfm,spotify")
|
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)
|
Parse(files ...string) (map[string]map[string][]string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Extract(files ...string) (map[string]*Tags, error) {
|
var parsers = map[string]Parser{
|
||||||
var e Parser
|
"ffmpeg": &ffmpeg.Parser{},
|
||||||
|
"taglib": &taglib.Parser{},
|
||||||
|
}
|
||||||
|
|
||||||
switch conf.Server.Scanner.Extractor {
|
func Extract(files ...string) (map[string]*Tags, error) {
|
||||||
case "taglib":
|
p, ok := parsers[conf.Server.Scanner.Extractor]
|
||||||
e = &taglib.Parser{}
|
if !ok {
|
||||||
case "ffmpeg":
|
log.Warn("Invalid 'Scanner.Extractor' option. Using default", "requested", conf.Server.Scanner.Extractor,
|
||||||
e = &ffmpeg.Parser{}
|
"validOptions", "ffmpeg,taglib", "default", conf.DefaultScannerExtractor)
|
||||||
default:
|
p = parsers[conf.DefaultScannerExtractor]
|
||||||
log.Warn("Invalid 'Scanner.Extractor' option. Using default 'taglib'", "requested", conf.Server.Scanner.Extractor,
|
|
||||||
"validOptions", "ffmpeg,taglib")
|
|
||||||
e = &taglib.Parser{}
|
|
||||||
}
|
}
|
||||||
extractedTags, err := e.Parse(files...)
|
|
||||||
|
extractedTags, err := p.Parse(files...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue