Demo: Restore albums from YAML backups
This commit is contained in:
parent
4c5a730da4
commit
ac5a9d5ee4
|
@ -27,6 +27,7 @@ ENV PHOTOPRISM_JPEG_QUALITY 95
|
|||
ENV PHOTOPRISM_SITE_CAPTION "Demo"
|
||||
|
||||
# Import example photos
|
||||
RUN photoprism restore -a
|
||||
RUN photoprism index
|
||||
RUN photoprism moments
|
||||
|
||||
|
|
|
@ -80,10 +80,12 @@ func RestoreAlbums(force bool) (count int, result error) {
|
|||
if err := a.LoadFromYaml(fileName); err != nil {
|
||||
log.Errorf("restore: %s in %s", err, txt.Quote(filepath.Base(fileName)))
|
||||
result = err
|
||||
} else if len(a.Photos) == 0 && a.AlbumFilter == "" {
|
||||
} else if a.AlbumType == "" || len(a.Photos) == 0 && a.AlbumFilter == "" {
|
||||
log.Debugf("restore: skipping %s", txt.Quote(filepath.Base(fileName)))
|
||||
} else if err := a.Find(); err == nil {
|
||||
log.Infof("%s: %s already exists", a.AlbumType, txt.Quote(a.AlbumTitle))
|
||||
} else if err := a.Create(); err != nil {
|
||||
log.Warnf("%s: %s already exists", a.AlbumType, txt.Quote(a.AlbumTitle))
|
||||
log.Errorf("%s: %s in %s", a.AlbumType, err, txt.Quote(filepath.Base(fileName)))
|
||||
} else {
|
||||
count++
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue