Genericise sliceutil functions (#4253)

* Genericise sliceutil.SliceSame
* Genericise intslice functions
* Genericise stringutil functions
This commit is contained in:
DingDongSoLong4
2023-11-01 23:58:32 +02:00
committed by GitHub
parent cc6673f276
commit 9621213424
51 changed files with 259 additions and 409 deletions

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/sliceutil/intslice"
"github.com/stashapp/stash/pkg/sliceutil"
)
type ContentsChangedError struct {
@@ -42,7 +42,7 @@ func (s *Service) ValidateImageGalleryChange(ctx context.Context, i *models.Imag
changedIDs = updateIDs.IDs
case models.RelationshipUpdateModeSet:
// get the difference between the two lists
changedIDs = intslice.IntNotIntersect(i.GalleryIDs.List(), updateIDs.IDs)
changedIDs = sliceutil.NotIntersect(i.GalleryIDs.List(), updateIDs.IDs)
}
galleries, err := s.Repository.FindMany(ctx, changedIDs)