Feature: Tag StashID support (#6255)

This commit is contained in:
Gykes
2025-11-12 19:24:09 -08:00
committed by GitHub
parent a08d2e258a
commit c99825a453
30 changed files with 387 additions and 34 deletions

View File

@@ -153,6 +153,8 @@ func (g sceneRelationships) tags(ctx context.Context) ([]int, error) {
tagIDs = originalTagIDs
}
endpoint := g.result.source.RemoteSite
for _, t := range scraped {
if t.StoredID != nil {
// existing tag, just add it
@@ -163,10 +165,9 @@ func (g sceneRelationships) tags(ctx context.Context) ([]int, error) {
tagIDs = sliceutil.AppendUnique(tagIDs, int(tagID))
} else if createMissing {
newTag := models.NewTag()
newTag.Name = t.Name
newTag := t.ToTag(endpoint, nil)
err := g.tagCreator.Create(ctx, &newTag)
err := g.tagCreator.Create(ctx, newTag)
if err != nil {
return nil, fmt.Errorf("error creating tag: %w", err)
}