mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Rebuild association tables, ensure file-system-based galleries cannot be changed (#2955)
* Re-create tables to include primary keys * Filesystem-based galleries cannot change images
This commit is contained in:
@@ -1168,6 +1168,14 @@ func (qb *GalleryStore) GetImageIDs(ctx context.Context, galleryID int) ([]int,
|
||||
return qb.imagesRepository().getIDs(ctx, galleryID)
|
||||
}
|
||||
|
||||
func (qb *GalleryStore) AddImages(ctx context.Context, galleryID int, imageIDs ...int) error {
|
||||
return qb.imagesRepository().insertOrIgnore(ctx, galleryID, imageIDs...)
|
||||
}
|
||||
|
||||
func (qb *GalleryStore) RemoveImages(ctx context.Context, galleryID int, imageIDs ...int) error {
|
||||
return qb.imagesRepository().destroyJoins(ctx, galleryID, imageIDs...)
|
||||
}
|
||||
|
||||
func (qb *GalleryStore) UpdateImages(ctx context.Context, galleryID int, imageIDs []int) error {
|
||||
// Delete the existing joins and then create new ones
|
||||
return qb.imagesRepository().replace(ctx, galleryID, imageIDs)
|
||||
|
||||
Reference in New Issue
Block a user