mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
feat: MaxTranscodingCacheSize is now specified in MB
This commit is contained in:
parent
14b33bc34d
commit
876354e58e
2 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ type nd struct {
|
||||||
|
|
||||||
EnableDownsampling bool `default:"false"`
|
EnableDownsampling bool `default:"false"`
|
||||||
MaxBitRate int `default:"0"`
|
MaxBitRate int `default:"0"`
|
||||||
MaxTranscodingCacheSize int64 `default:"100000000"` // 100MB
|
MaxTranscodingCacheSize int64 `default:"100"` // in MB
|
||||||
DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"`
|
DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"`
|
||||||
ProbeCommand string `default:"ffmpeg -i %s -f ffmetadata"`
|
ProbeCommand string `default:"ffmpeg -i %s -f ffmetadata"`
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ func getFinalCachedSize(r fscache.ReadAtCloser) int64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTranscodingCache() (fscache.Cache, error) {
|
func NewTranscodingCache() (fscache.Cache, error) {
|
||||||
lru := fscache.NewLRUHaunter(0, conf.Server.MaxTranscodingCacheSize, 10*time.Minute)
|
lru := fscache.NewLRUHaunter(0, conf.Server.MaxTranscodingCacheSize*1024*1024, 10*time.Minute)
|
||||||
h := fscache.NewLRUHaunterStrategy(lru)
|
h := fscache.NewLRUHaunterStrategy(lru)
|
||||||
cacheFolder := filepath.Join(conf.Server.DataFolder, consts.CacheDir)
|
cacheFolder := filepath.Join(conf.Server.DataFolder, consts.CacheDir)
|
||||||
fs, err := fscache.NewFs(cacheFolder, 0755)
|
fs, err := fscache.NewFs(cacheFolder, 0755)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue