aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/server/main.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index c064d56..b81b291 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -24,6 +24,7 @@ import (
"git.sr.ht/~gabrielgio/img/pkg/service"
"git.sr.ht/~gabrielgio/img/pkg/view"
"git.sr.ht/~gabrielgio/img/pkg/worker"
+ "git.sr.ht/~gabrielgio/img/pkg/worker/scanner"
)
func main() {
@@ -34,9 +35,6 @@ func main() {
logLevel = flag.String("log-level", "error", "Log level: Choose either trace, debug, info, warning, error, fatal or panic")
schedulerCount = flag.Uint("scheduler-count", 10, "How many workers are created to process media files")
cachePath = flag.String("cache-path", "", "Folder to store thumbnail image")
-
- // TODO: this will later be replaced by user specific root folder
- root = flag.String("root", "", "root folder for the whole application. All the workers will use it as working directory")
)
flag.Parse()
@@ -76,7 +74,7 @@ func main() {
var (
userRepository = sql.NewUserRepository(db)
settingsRepository = sql.NewSettingsRespository(db)
- fileSystemRepository = localfs.NewFileSystemRepository(*root)
+ fileSystemRepository = localfs.NewFileSystemRepository()
mediaRepository = sql.NewMediaRepository(db)
)
@@ -113,9 +111,9 @@ func main() {
// processors
var (
- fileScanner = worker.NewFileScanner(*root, mediaRepository)
- exifScanner = worker.NewEXIFScanner(mediaRepository)
- thumbnailScanner = worker.NewThumbnailScanner(*cachePath, mediaRepository)
+ fileScanner = scanner.NewFileScanner(mediaRepository, userRepository)
+ exifScanner = scanner.NewEXIFScanner(mediaRepository)
+ thumbnailScanner = scanner.NewThumbnailScanner(*cachePath, mediaRepository)
)
// worker