mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34: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:
@@ -270,22 +270,22 @@ func (_m *StudioReaderWriter) GetImage(ctx context.Context, studioID int) ([]byt
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetStashIDs provides a mock function with given fields: ctx, studioID
|
||||
func (_m *StudioReaderWriter) GetStashIDs(ctx context.Context, studioID int) ([]*models.StashID, error) {
|
||||
ret := _m.Called(ctx, studioID)
|
||||
// GetStashIDs provides a mock function with given fields: ctx, relatedID
|
||||
func (_m *StudioReaderWriter) GetStashIDs(ctx context.Context, relatedID int) ([]models.StashID, error) {
|
||||
ret := _m.Called(ctx, relatedID)
|
||||
|
||||
var r0 []*models.StashID
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int) []*models.StashID); ok {
|
||||
r0 = rf(ctx, studioID)
|
||||
var r0 []models.StashID
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int) []models.StashID); ok {
|
||||
r0 = rf(ctx, relatedID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*models.StashID)
|
||||
r0 = ret.Get(0).([]models.StashID)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
|
||||
r1 = rf(ctx, studioID)
|
||||
r1 = rf(ctx, relatedID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -442,11 +442,11 @@ func (_m *StudioReaderWriter) UpdateImage(ctx context.Context, studioID int, ima
|
||||
}
|
||||
|
||||
// UpdateStashIDs provides a mock function with given fields: ctx, studioID, stashIDs
|
||||
func (_m *StudioReaderWriter) UpdateStashIDs(ctx context.Context, studioID int, stashIDs []*models.StashID) error {
|
||||
func (_m *StudioReaderWriter) UpdateStashIDs(ctx context.Context, studioID int, stashIDs []models.StashID) error {
|
||||
ret := _m.Called(ctx, studioID, stashIDs)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int, []*models.StashID) error); ok {
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int, []models.StashID) error); ok {
|
||||
r0 = rf(ctx, studioID, stashIDs)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
|
||||
Reference in New Issue
Block a user