mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
35 lines
666 B
Go
35 lines
666 B
Go
package src
|
|
|
|
import "os"
|
|
|
|
func GetEnvOr(env string, def string) string {
|
|
out := os.Getenv(env)
|
|
if out == "" {
|
|
return def
|
|
}
|
|
return out
|
|
}
|
|
|
|
type SettingsT struct {
|
|
Outpath string
|
|
Metadata string
|
|
RoutePrefix string
|
|
SafePath string
|
|
HwAccel HwAccelT
|
|
}
|
|
|
|
type HwAccelT struct {
|
|
Name string
|
|
DecodeFlags []string
|
|
EncodeFlags []string
|
|
ScaleFilter string
|
|
}
|
|
|
|
var Settings = SettingsT{
|
|
Outpath: GetEnvOr("GOCODER_CACHE_ROOT", "/cache"),
|
|
Metadata: GetEnvOr("GOCODER_METADATA_ROOT", "/metadata"),
|
|
RoutePrefix: GetEnvOr("GOCODER_PREFIX", ""),
|
|
SafePath: GetEnvOr("GOCODER_SAFE_PATH", "/video"),
|
|
HwAccel: DetectHardwareAccel(),
|
|
}
|