mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
[Files Refactor] Performance tuning (#2819)
* Load scene relationships on demand * Load image relationships on demand * Load gallery relationships on demand * Add dataloaden * Use dataloaders * Use where in for other find many functions
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
type StudioCreator interface {
|
||||
Create(ctx context.Context, newStudio models.Studio) (*models.Studio, error)
|
||||
UpdateStashIDs(ctx context.Context, studioID int, stashIDs []*models.StashID) error
|
||||
UpdateStashIDs(ctx context.Context, studioID int, stashIDs []models.StashID) error
|
||||
}
|
||||
|
||||
func createMissingStudio(ctx context.Context, endpoint string, w StudioCreator, studio *models.ScrapedStudio) (*int, error) {
|
||||
@@ -22,7 +22,7 @@ func createMissingStudio(ctx context.Context, endpoint string, w StudioCreator,
|
||||
}
|
||||
|
||||
if endpoint != "" && studio.RemoteSiteID != nil {
|
||||
if err := w.UpdateStashIDs(ctx, created.ID, []*models.StashID{
|
||||
if err := w.UpdateStashIDs(ctx, created.ID, []models.StashID{
|
||||
{
|
||||
Endpoint: endpoint,
|
||||
StashID: *studio.RemoteSiteID,
|
||||
|
||||
Reference in New Issue
Block a user