From deb6808c75b54ac23f3332ac32525b475dd267f3 Mon Sep 17 00:00:00 2001 From: davy wybiral Date: Wed, 3 Jul 2019 13:25:42 -0500 Subject: Multipath (#10) * added multiple paths * prevent path duplicates --- pkg/app/config.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'pkg/app/config.go') diff --git a/pkg/app/config.go b/pkg/app/config.go index f8ca2e8..c2ecb45 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -7,9 +7,15 @@ import ( // Config settings for main App. type Config struct { - LibraryPath string `json:"library"` - Server *ServerConfig `json:"server"` - Feed *FeedConfig `json:"feed"` + Library []*PathConfig `json:"library"` + Server *ServerConfig `json:"server"` + Feed *FeedConfig `json:"feed"` +} + +// PathConfig settings for media library path. +type PathConfig struct { + Path string `json:"path"` + Prefix string `json:"prefix"` } // ServerConfig settings for App Server. @@ -34,7 +40,12 @@ type FeedConfig struct { // DefaultConfig returns Config initialized with default values. func DefaultConfig() *Config { return &Config{ - LibraryPath: "videos", + Library: []*PathConfig{ + &PathConfig{ + Path: "videos", + Prefix: "", + }, + }, Server: &ServerConfig{ Host: "127.0.0.1", Port: 0, -- cgit v1.2.3