mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Containing Group/Sub-Group relationships (#5105)
* Add UI support for setting containing groups * Show containing groups in group details panel * Move tag hierarchical filter code into separate type * Add depth to scene_count and add sub_group_count * Add sub-groups tab to groups page * Add containing groups to edit groups dialog * Show containing group description in sub-group view * Show group scene number in group scenes view * Add ability to drag move grid cards * Add sub group order option * Add reorder sub-groups interface * Separate page size selector component * Add interfaces to add and remove sub-groups to a group * Separate MultiSet components * Allow setting description while setting containing groups
This commit is contained in:
@@ -21,6 +21,9 @@ type Group struct {
|
||||
|
||||
URLs RelatedStrings `json:"urls"`
|
||||
TagIDs RelatedIDs `json:"tag_ids"`
|
||||
|
||||
ContainingGroups RelatedGroupDescriptions `json:"containing_groups"`
|
||||
SubGroups RelatedGroupDescriptions `json:"sub_groups"`
|
||||
}
|
||||
|
||||
func NewGroup() Group {
|
||||
@@ -43,20 +46,34 @@ func (m *Group) LoadTagIDs(ctx context.Context, l TagIDLoader) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (m *Group) LoadContainingGroupIDs(ctx context.Context, l ContainingGroupLoader) error {
|
||||
return m.ContainingGroups.load(func() ([]GroupIDDescription, error) {
|
||||
return l.GetContainingGroupDescriptions(ctx, m.ID)
|
||||
})
|
||||
}
|
||||
|
||||
func (m *Group) LoadSubGroupIDs(ctx context.Context, l SubGroupLoader) error {
|
||||
return m.SubGroups.load(func() ([]GroupIDDescription, error) {
|
||||
return l.GetSubGroupDescriptions(ctx, m.ID)
|
||||
})
|
||||
}
|
||||
|
||||
type GroupPartial struct {
|
||||
Name OptionalString
|
||||
Aliases OptionalString
|
||||
Duration OptionalInt
|
||||
Date OptionalDate
|
||||
// Rating expressed in 1-100 scale
|
||||
Rating OptionalInt
|
||||
StudioID OptionalInt
|
||||
Director OptionalString
|
||||
Synopsis OptionalString
|
||||
URLs *UpdateStrings
|
||||
TagIDs *UpdateIDs
|
||||
CreatedAt OptionalTime
|
||||
UpdatedAt OptionalTime
|
||||
Rating OptionalInt
|
||||
StudioID OptionalInt
|
||||
Director OptionalString
|
||||
Synopsis OptionalString
|
||||
URLs *UpdateStrings
|
||||
TagIDs *UpdateIDs
|
||||
ContainingGroups *UpdateGroupDescriptions
|
||||
SubGroups *UpdateGroupDescriptions
|
||||
CreatedAt OptionalTime
|
||||
UpdatedAt OptionalTime
|
||||
}
|
||||
|
||||
func NewGroupPartial() GroupPartial {
|
||||
|
||||
Reference in New Issue
Block a user