mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +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:
@@ -1134,6 +1134,10 @@ func (t *ExportTask) exportGroup(ctx context.Context, wg *sync.WaitGroup, jobCha
|
||||
logger.Errorf("[groups] <%s> error getting group urls: %v", m.Name, err)
|
||||
continue
|
||||
}
|
||||
if err := m.LoadSubGroupIDs(ctx, r.Group); err != nil {
|
||||
logger.Errorf("[groups] <%s> error getting group sub-groups: %v", m.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
newGroupJSON, err := group.ToJSON(ctx, groupReader, studioReader, m)
|
||||
|
||||
@@ -1150,6 +1154,25 @@ func (t *ExportTask) exportGroup(ctx context.Context, wg *sync.WaitGroup, jobCha
|
||||
|
||||
newGroupJSON.Tags = tag.GetNames(tags)
|
||||
|
||||
subGroups := m.SubGroups.List()
|
||||
if err := func() error {
|
||||
for _, sg := range subGroups {
|
||||
subGroup, err := groupReader.Find(ctx, sg.GroupID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error getting sub group: %v", err)
|
||||
}
|
||||
|
||||
newGroupJSON.SubGroups = append(newGroupJSON.SubGroups, jsonschema.SubGroupDescription{
|
||||
// TODO - this won't be unique
|
||||
Group: subGroup.Name,
|
||||
Description: sg.Description,
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
logger.Errorf("[groups] <%s> %v", m.Name, err)
|
||||
}
|
||||
|
||||
if t.includeDependencies {
|
||||
if m.StudioID != nil {
|
||||
t.studios.IDs = sliceutil.AppendUnique(t.studios.IDs, *m.StudioID)
|
||||
|
||||
Reference in New Issue
Block a user