Fix gallery scan (#2594)

The incorrect error check means that images is always 0, which means scanImages is also always true, which causes the images inside the zip to be unnecessarily rescanned every time.
This commit is contained in:
DingDongSoLong4 2022-05-18 04:03:54 +02:00 committed by GitHub
parent 1200d4472a
commit df24f90735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ func (t *ScanTask) scanGallery(ctx context.Context) {
var err error
g, err = r.Gallery().FindByPath(path)
if g != nil && err != nil {
if g != nil && err == nil {
images, err = r.Image().CountByGalleryID(g.ID)
if err != nil {
return fmt.Errorf("error getting images for zip gallery %s: %s", path, err.Error())