Handle file rescan (#2951)

* Fire handlers when file updated or moved
* Create galleries as needed
* Clean empty galleries
* Handle cleaning zip folders when path changed
* Fix gallery association on duplicate images
* Re-create missing folder-based galleries
This commit is contained in:
WithoutPants
2022-09-28 16:08:00 +10:00
committed by GitHub
parent 00820a8789
commit dce90a3ed9
13 changed files with 439 additions and 106 deletions

View File

@@ -338,7 +338,9 @@ func (j *cleanJob) shouldCleanFolder(ctx context.Context, f *Folder) bool {
path := f.Path
info, err := f.Info(j.FS)
if err != nil && !errors.Is(err, fs.ErrNotExist) {
// ErrInvalid can occur in zip files where the zip file path changed
// and the underlying folder did not
if err != nil && !errors.Is(err, fs.ErrNotExist) && !errors.Is(err, fs.ErrInvalid) {
logger.Errorf("error getting folder info for %q, not cleaning: %v", path, err)
return false
}