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

@@ -7,10 +7,9 @@ import (
"strings"
"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"
)
@@ -27,6 +26,7 @@ func copyAction(ctx *cli.Context) error {
start := time.Now()
conf := config.NewConfig(ctx)
service.SetConfig(conf)
// very if copy directory exist and is writable
if conf.ReadOnly() {
@@ -66,14 +66,7 @@ func copyAction(ctx *cli.Context) error {
log.Infof("copying media files from %s to %s", sourcePath, conf.OriginalsPath())
tensorFlow := classify.New(conf.ResourcesPath(), conf.TensorFlowDisabled())
nsfwDetector := nsfw.New(conf.NSFWModelPath())
ind := photoprism.NewIndex(conf, tensorFlow, nsfwDetector)
convert := photoprism.NewConvert(conf)
imp := photoprism.NewImport(conf, ind, convert)
imp := service.Import()
opt := photoprism.ImportOptionsCopy(sourcePath)
imp.Start(opt)