mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Feature: Tag StashID support (#6255)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user