@@ -5,7 +5,6 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
@@ -14,6 +13,7 @@ import (
|
||||
|
||||
"go.senan.xyz/gonic/db"
|
||||
"go.senan.xyz/gonic/jukebox"
|
||||
"go.senan.xyz/gonic/paths"
|
||||
"go.senan.xyz/gonic/podcasts"
|
||||
"go.senan.xyz/gonic/scanner"
|
||||
"go.senan.xyz/gonic/scanner/tags"
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
|
||||
type Options struct {
|
||||
DB *db.DB
|
||||
MusicPaths []string
|
||||
MusicPaths paths.MusicPaths
|
||||
PodcastPath string
|
||||
CachePath string
|
||||
CoverCachePath string
|
||||
@@ -48,15 +48,9 @@ type Server struct {
|
||||
}
|
||||
|
||||
func New(opts Options) (*Server, error) {
|
||||
for i, musicPath := range opts.MusicPaths {
|
||||
opts.MusicPaths[i] = filepath.Clean(musicPath)
|
||||
}
|
||||
opts.CachePath = filepath.Clean(opts.CachePath)
|
||||
opts.PodcastPath = filepath.Clean(opts.PodcastPath)
|
||||
|
||||
tagger := &tags.TagReader{}
|
||||
|
||||
scanner := scanner.New(opts.MusicPaths, opts.DB, opts.GenreSplit, tagger)
|
||||
scanner := scanner.New(opts.MusicPaths.Paths(), opts.DB, opts.GenreSplit, tagger)
|
||||
base := &ctrlbase.Controller{
|
||||
DB: opts.DB,
|
||||
ProxyPrefix: opts.ProxyPrefix,
|
||||
|
||||
Reference in New Issue
Block a user