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:
@@ -30,9 +30,13 @@ type StudioFilterType struct {
|
||||
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
|
||||
}
|
||||
|
||||
type StudioFinder interface {
|
||||
FindMany(ctx context.Context, ids []int) ([]*Studio, error)
|
||||
}
|
||||
|
||||
type StudioReader interface {
|
||||
Find(ctx context.Context, id int) (*Studio, error)
|
||||
FindMany(ctx context.Context, ids []int) ([]*Studio, error)
|
||||
StudioFinder
|
||||
FindChildren(ctx context.Context, id int) ([]*Studio, error)
|
||||
FindByName(ctx context.Context, name string, nocase bool) (*Studio, error)
|
||||
FindByStashID(ctx context.Context, stashID StashID) ([]*Studio, error)
|
||||
@@ -44,7 +48,7 @@ type StudioReader interface {
|
||||
Query(ctx context.Context, studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int, error)
|
||||
GetImage(ctx context.Context, studioID int) ([]byte, error)
|
||||
HasImage(ctx context.Context, studioID int) (bool, error)
|
||||
GetStashIDs(ctx context.Context, studioID int) ([]*StashID, error)
|
||||
StashIDLoader
|
||||
GetAliases(ctx context.Context, studioID int) ([]string, error)
|
||||
}
|
||||
|
||||
@@ -55,7 +59,7 @@ type StudioWriter interface {
|
||||
Destroy(ctx context.Context, id int) error
|
||||
UpdateImage(ctx context.Context, studioID int, image []byte) error
|
||||
DestroyImage(ctx context.Context, studioID int) error
|
||||
UpdateStashIDs(ctx context.Context, studioID int, stashIDs []*StashID) error
|
||||
UpdateStashIDs(ctx context.Context, studioID int, stashIDs []StashID) error
|
||||
UpdateAliases(ctx context.Context, studioID int, aliases []string) error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user