Update FieldStrategyOverwrite to work when scene has no existing URL (#4412)

This commit is contained in:
bayured 2024-01-08 23:23:29 +00:00 committed by GitHub
parent 743ab9a52c
commit f5e3fe77b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -392,7 +392,7 @@ func getScenePartial(scene *models.Scene, scraped *scraper.ScrapedScene, fieldOp
switch getFieldStrategy(fieldOptions["url"]) {
case FieldStrategyOverwrite:
// only overwrite if not equal
if len(sliceutil.Exclude(scene.URLs.List(), scraped.URLs)) != 0 {
if len(sliceutil.Exclude(scraped.URLs, scene.URLs.List())) != 0 {
partial.URLs = &models.UpdateStrings{
Values: scraped.URLs,
Mode: models.RelationshipUpdateModeSet,