stash/pkg/models/stash_ids.go
WithoutPants 4a054ab081
Support file-less scenes. Add scene split, merge and reassign file (#3006)
* Reassign scene file functionality
* Implement scene create
* Add scene create UI
* Add sceneMerge backend support
* Add merge scene to UI
* Populate split create with scene details
* Add merge button to duplicate checker
* Handle file-less scenes in marker preview generate
* Make unique file name for file-less scene exports
* Add o-counter to scene update input
* Hide rescan for file-less scenes
* Generate heatmap if no speed set on file
* Fix count in scene/image queries
2022-11-14 16:35:09 +11:00

22 lines
581 B
Go

package models
type StashID struct {
StashID string `db:"stash_id" json:"stash_id"`
Endpoint string `db:"endpoint" json:"endpoint"`
}
type UpdateStashIDs struct {
StashIDs []StashID `json:"stash_ids"`
Mode RelationshipUpdateMode `json:"mode"`
}
// AddUnique adds the stash id to the list, only if the endpoint/stashid pair does not already exist in the list.
func (u *UpdateStashIDs) AddUnique(v StashID) {
for _, vv := range u.StashIDs {
if vv.StashID == v.StashID && vv.Endpoint == v.Endpoint {
return
}
}
u.StashIDs = append(u.StashIDs, v)
}