Refactor indexer so that thumbs and jpegs can be created on demand #258

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-05-06 10:35:41 +02:00
parent 6c6ea0ac3d
commit 1479a3ec5b
20 changed files with 147 additions and 166 deletions

View File

@@ -23,6 +23,10 @@ var indexFlags = []cli.Flag{
Name: "all, a",
Usage: "re-index all originals, including unchanged files",
},
cli.BoolFlag{
Name: "convert, c",
Usage: "convert raw to jpeg so that they can be displayed in a browser",
},
}
// indexAction indexes all photos in originals directory (photo library)
@@ -51,12 +55,9 @@ func indexAction(ctx *cli.Context) error {
ind := service.Index()
var opt photoprism.IndexOptions
if ctx.Bool("all") {
opt = photoprism.IndexOptionsAll()
} else {
opt = photoprism.IndexOptionsNone()
opt := photoprism.IndexOptions{
Rescan: ctx.Bool("all"),
Convert: ctx.Bool("convert"),
}
files := ind.Start(opt)