Model refactor (#3915)

* Add mockery config file
* Move basic file/folder structs to models
* Fix hack due to import loop
* Move file interfaces to models
* Move folder interfaces to models
* Move scene interfaces to models
* Move scene marker interfaces to models
* Move image interfaces to models
* Move gallery interfaces to models
* Move gallery chapter interfaces to models
* Move studio interfaces to models
* Move movie interfaces to models
* Move performer interfaces to models
* Move tag interfaces to models
* Move autotag interfaces to models
* Regenerate mocks
This commit is contained in:
DingDongSoLong4
2023-09-01 02:39:29 +02:00
committed by GitHub
parent 20520a58b4
commit c364346a59
185 changed files with 3840 additions and 2559 deletions

View File

@@ -58,13 +58,13 @@ func (_m *StudioReaderWriter) Count(ctx context.Context) (int, error) {
return r0, r1
}
// Create provides a mock function with given fields: ctx, input
func (_m *StudioReaderWriter) Create(ctx context.Context, input *models.Studio) error {
ret := _m.Called(ctx, input)
// Create provides a mock function with given fields: ctx, newStudio
func (_m *StudioReaderWriter) Create(ctx context.Context, newStudio *models.Studio) error {
ret := _m.Called(ctx, newStudio)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Studio) error); ok {
r0 = rf(ctx, input)
r0 = rf(ctx, newStudio)
} else {
r0 = ret.Error(0)
}
@@ -132,6 +132,29 @@ func (_m *StudioReaderWriter) FindByName(ctx context.Context, name string, nocas
return r0, r1
}
// FindBySceneID provides a mock function with given fields: ctx, sceneID
func (_m *StudioReaderWriter) FindBySceneID(ctx context.Context, sceneID int) (*models.Studio, error) {
ret := _m.Called(ctx, sceneID)
var r0 *models.Studio
if rf, ok := ret.Get(0).(func(context.Context, int) *models.Studio); ok {
r0 = rf(ctx, sceneID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.Studio)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, sceneID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindByStashID provides a mock function with given fields: ctx, stashID
func (_m *StudioReaderWriter) FindByStashID(ctx context.Context, stashID models.StashID) ([]*models.Studio, error) {
ret := _m.Called(ctx, stashID)
@@ -395,13 +418,13 @@ func (_m *StudioReaderWriter) UpdateImage(ctx context.Context, studioID int, ima
return r0
}
// UpdatePartial provides a mock function with given fields: ctx, input
func (_m *StudioReaderWriter) UpdatePartial(ctx context.Context, input models.StudioPartial) (*models.Studio, error) {
ret := _m.Called(ctx, input)
// UpdatePartial provides a mock function with given fields: ctx, updatedStudio
func (_m *StudioReaderWriter) UpdatePartial(ctx context.Context, updatedStudio models.StudioPartial) (*models.Studio, error) {
ret := _m.Called(ctx, updatedStudio)
var r0 *models.Studio
if rf, ok := ret.Get(0).(func(context.Context, models.StudioPartial) *models.Studio); ok {
r0 = rf(ctx, input)
r0 = rf(ctx, updatedStudio)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.Studio)
@@ -410,7 +433,7 @@ func (_m *StudioReaderWriter) UpdatePartial(ctx context.Context, input models.St
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, models.StudioPartial) error); ok {
r1 = rf(ctx, input)
r1 = rf(ctx, updatedStudio)
} else {
r1 = ret.Error(1)
}