Backend: Refactor package structure

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-04-05 22:26:53 +02:00
parent 1a3966e798
commit aa220a06fe
25 changed files with 360 additions and 258 deletions

View File

@@ -4,10 +4,9 @@ import (
"context"
"time"
"github.com/photoprism/photoprism/internal/classify"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/nsfw"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/service"
"github.com/urfave/cli"
)
@@ -31,6 +30,7 @@ func indexAction(ctx *cli.Context) error {
start := time.Now()
conf := config.NewConfig(ctx)
service.SetConfig(conf)
if err := conf.CreateDirectories(); err != nil {
return err
@@ -49,9 +49,7 @@ func indexAction(ctx *cli.Context) error {
log.Infof("read-only mode enabled")
}
tf := classify.New(conf.ResourcesPath(), conf.TensorFlowDisabled())
nd := nsfw.New(conf.NSFWModelPath())
ind := photoprism.NewIndex(conf, tf, nd)
ind := service.Index()
var opt photoprism.IndexOptions