From e02f3d3ec98f14c2ccb7233e37fed48be8d95781 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 17 Mar 2020 15:16:50 -0400 Subject: [PATCH] refactor: clean up unused config options --- conf/configuration.go | 7 ++----- engine/media_streamer.go | 2 +- engine/media_streamer_test.go | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/conf/configuration.go b/conf/configuration.go index e87a038f3..84ce7ffbf 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -23,11 +23,8 @@ type nd struct { IgnoredArticles string `default:"The El La Los Las Le Les Os As O A"` IndexGroups string `default:"A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ) [Unknown]([)"` - EnableDownsampling bool `default:"false"` - MaxBitRate int `default:"0"` - MaxTranscodingCacheSize int64 `default:"100"` // in MB - DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"` - ProbeCommand string `default:"ffmpeg -i %s -f ffmetadata"` + TranscodingCacheSize int64 `default:"100"` // in MB + ProbeCommand string `default:"ffmpeg -i %s -f ffmetadata"` // DevFlags. These are used to enable/disable debugging and incomplete features DevDisableBanner bool `default:"false"` diff --git a/engine/media_streamer.go b/engine/media_streamer.go index 9c0c998a0..f9240a8d4 100644 --- a/engine/media_streamer.go +++ b/engine/media_streamer.go @@ -198,7 +198,7 @@ func getFinalCachedSize(r fscache.ReadAtCloser) int64 { } func NewTranscodingCache() (fscache.Cache, error) { - lru := fscache.NewLRUHaunter(0, conf.Server.MaxTranscodingCacheSize*1024*1024, 10*time.Minute) + lru := fscache.NewLRUHaunter(0, conf.Server.TranscodingCacheSize*1024*1024, 10*time.Minute) h := fscache.NewLRUHaunterStrategy(lru) cacheFolder := filepath.Join(conf.Server.DataFolder, consts.CacheDir) fs, err := fscache.NewFs(cacheFolder, 0755) diff --git a/engine/media_streamer_test.go b/engine/media_streamer_test.go index a7016ab9e..755eea8b1 100644 --- a/engine/media_streamer_test.go +++ b/engine/media_streamer_test.go @@ -7,7 +7,6 @@ import ( "os" "strings" - "github.com/deluan/navidrome/conf" "github.com/deluan/navidrome/log" "github.com/deluan/navidrome/model" "github.com/deluan/navidrome/persistence" @@ -31,7 +30,6 @@ var _ = Describe("MediaStreamer", func() { }) BeforeEach(func() { - conf.Server.EnableDownsampling = true ds = &persistence.MockDataStore{MockedTranscoding: &mockTranscodingRepository{}} ds.MediaFile(ctx).(*persistence.MockMediaFile).SetData(`[{"id": "123", "path": "tests/fixtures/test.mp3", "suffix": "mp3", "bitRate": 128, "duration": 257.0}]`, 1) streamer = NewMediaStreamer(ds, ffmpeg, cache)