Add tag stash ids filter criterion (#6403)

* Add stash id filter to tag filter
* Add tag stash id criterion in UI
This commit is contained in:
WithoutPants
2025-12-12 08:54:57 +11:00
committed by GitHub
parent 25fdf676d2
commit 67b1dd8dd0
6 changed files with 131 additions and 0 deletions

View File

@@ -1688,6 +1688,13 @@ func getTagChildCount(id int) int {
return 0
}
func tagStashID(i int) models.StashID {
return models.StashID{
StashID: getTagStringValue(i, "stashid"),
Endpoint: getTagStringValue(i, "endpoint"),
}
}
// createTags creates n tags with plain Name and o tags with camel cased NaMe included
func createTags(ctx context.Context, tqb models.TagReaderWriter, n int, o int) error {
const namePlain = "Name"
@@ -1709,6 +1716,12 @@ func createTags(ctx context.Context, tqb models.TagReaderWriter, n int, o int) e
IgnoreAutoTag: getIgnoreAutoTag(i),
}
if (index+1)%5 != 0 {
tag.StashIDs = models.NewRelatedStashIDs([]models.StashID{
tagStashID(i),
})
}
err := tqb.Create(ctx, &tag)
if err != nil {