mirror of https://github.com/stashapp/stash.git
Check if gallery is already associated during scanning (#1154)
This commit is contained in:
parent
4825de7d35
commit
fe990e00c1
|
@ -315,14 +315,22 @@ func (t *ScanTask) associateGallery(wg *sizedwaitgroup.SizedWaitGroup) {
|
|||
scene, _ := sqb.FindByPath(scenePath)
|
||||
// found related Scene
|
||||
if scene != nil {
|
||||
logger.Infof("associate: Gallery %s is related to scene: %d", t.FilePath, scene.ID)
|
||||
|
||||
if err := sqb.UpdateGalleries(scene.ID, []int{g.ID}); err != nil {
|
||||
return err
|
||||
sceneGalleries, _ := sqb.FindByGalleryID(g.ID) // check if gallery is already associated to the scene
|
||||
isAssoc := false
|
||||
for _, sg := range sceneGalleries {
|
||||
if scene.ID == sg.ID {
|
||||
isAssoc = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !isAssoc {
|
||||
logger.Infof("associate: Gallery %s is related to scene: %d", t.FilePath, scene.ID)
|
||||
if err := sqb.UpdateGalleries(scene.ID, []int{g.ID}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}); err != nil {
|
||||
logger.Error(err.Error())
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* Added Rescan button to scene, image, gallery details overflow button.
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Fix scan re-associating galleries to the same scene.
|
||||
* Fix SQL error when filtering galleries excluding performers or tags.
|
||||
* Fix version checking for armv7 and arm64.
|
||||
* Change "Is NULL" filter to include empty string values.
|
||||
|
|
Loading…
Reference in New Issue