Skip to content

Commit

Permalink
feat: Refresh Actor Data After Manually Linking to Stashdb (xbapps#1809)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Aug 5, 2024
1 parent c28daea commit 76b7311
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/api/actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
restfulspec "github.com/emicklei/go-restful-openapi/v2"
"github.com/emicklei/go-restful/v3"
"github.com/xbapps/xbvr/pkg/models"
"github.com/xbapps/xbvr/pkg/scrape"
)

type ResponseGetActors struct {
Expand Down Expand Up @@ -755,6 +756,9 @@ func (i ActorResource) editActorExtRefs(req *restful.Request, resp *restful.Resp
ExternalReferenceID: extref.ID, ExternalSource: extref.ExternalSource, ExternalId: extref.ExternalId, MatchType: 0})
extref.Save()
models.AddActionActor(actor.ID, "edit_actor", "add", "external_reference_link", url)
if extref.ExternalSource == "stashdb performer" {
scrape.RefreshPerformer(extref.ExternalId)
}
} else {
// external reference exists, but check it is linked to this actor
found := false
Expand All @@ -770,6 +774,9 @@ func (i ActorResource) editActorExtRefs(req *restful.Request, resp *restful.Resp
ExternalReferenceID: extref.ID, ExternalSource: extref.ExternalSource, ExternalId: extref.ExternalId, MatchType: 0}
newLink.Save()
models.AddActionActor(actor.ID, "edit_actor", "add", "external_reference_link", url)
if extref.ExternalSource == "stashdb performer" {
scrape.RefreshPerformer(extref.ExternalId)
}
}
}
}
Expand Down

0 comments on commit 76b7311

Please sign in to comment.