Reload faces if albums or media is deleted

This commit is contained in:
viktorstrate
2021-02-27 16:39:04 +01:00
parent d4552c7724
commit 26996b45e5
3 changed files with 33 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/photoview/photoview/api/graphql/auth"
"github.com/photoview/photoview/api/graphql/models"
"github.com/photoview/photoview/api/scanner"
"github.com/photoview/photoview/api/scanner/face_detection"
"github.com/photoview/photoview/api/utils"
"github.com/pkg/errors"
"golang.org/x/crypto/bcrypt"
@@ -359,6 +360,10 @@ func (r *mutationResolver) UserRemoveRootAlbum(ctx context.Context, userID int,
deletedAlbumIDs = nil
return err
}
if err := face_detection.GlobalFaceDetector.ReloadFacesFromDatabase(); err != nil {
return err
}
}
return nil