mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
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
This commit is contained in:
@@ -529,6 +529,17 @@ func (t *relatedFilesTable) replaceJoins(ctx context.Context, id int, fileIDs []
|
||||
return t.insertJoins(ctx, id, firstPrimary, fileIDs)
|
||||
}
|
||||
|
||||
// destroyJoins destroys all entries in the table with the provided fileIDs
|
||||
func (t *relatedFilesTable) destroyJoins(ctx context.Context, fileIDs []file.ID) error {
|
||||
q := dialect.Delete(t.table.table).Where(t.table.table.Col("file_id").In(fileIDs))
|
||||
|
||||
if _, err := exec(ctx, q); err != nil {
|
||||
return fmt.Errorf("destroying file joins in %s: %w", t.table.table.GetTable(), err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *relatedFilesTable) setPrimary(ctx context.Context, id int, fileID file.ID) error {
|
||||
table := t.table.table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user