stash/pkg/models/mocks/FolderReaderWriter.go
WithoutPants 4017c42fe2
Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327)
* Find existing files with case insensitivity if filesystem is case insensitive
* Handle case change in folders
* Optimise to only test file system case sensitivity if the first query found nothing

This limits the overhead to new paths, and adds an extra query for new paths to windows installs
2025-12-02 12:53:37 +11:00

239 lines
6.1 KiB
Go

// Code generated by mockery v2.10.0. DO NOT EDIT.
package mocks
import (
context "context"
models "github.com/stashapp/stash/pkg/models"
mock "github.com/stretchr/testify/mock"
)
// FolderReaderWriter is an autogenerated mock type for the FolderReaderWriter type
type FolderReaderWriter struct {
mock.Mock
}
// CountAllInPaths provides a mock function with given fields: ctx, p
func (_m *FolderReaderWriter) CountAllInPaths(ctx context.Context, p []string) (int, error) {
ret := _m.Called(ctx, p)
var r0 int
if rf, ok := ret.Get(0).(func(context.Context, []string) int); ok {
r0 = rf(ctx, p)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok {
r1 = rf(ctx, p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Create provides a mock function with given fields: ctx, f
func (_m *FolderReaderWriter) Create(ctx context.Context, f *models.Folder) error {
ret := _m.Called(ctx, f)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Folder) error); ok {
r0 = rf(ctx, f)
} else {
r0 = ret.Error(0)
}
return r0
}
// Destroy provides a mock function with given fields: ctx, id
func (_m *FolderReaderWriter) Destroy(ctx context.Context, id models.FolderID) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, models.FolderID) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// Find provides a mock function with given fields: ctx, id
func (_m *FolderReaderWriter) Find(ctx context.Context, id models.FolderID) (*models.Folder, error) {
ret := _m.Called(ctx, id)
var r0 *models.Folder
if rf, ok := ret.Get(0).(func(context.Context, models.FolderID) *models.Folder); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, models.FolderID) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindAllInPaths provides a mock function with given fields: ctx, p, limit, offset
func (_m *FolderReaderWriter) FindAllInPaths(ctx context.Context, p []string, limit int, offset int) ([]*models.Folder, error) {
ret := _m.Called(ctx, p, limit, offset)
var r0 []*models.Folder
if rf, ok := ret.Get(0).(func(context.Context, []string, int, int) []*models.Folder); ok {
r0 = rf(ctx, p, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, []string, int, int) error); ok {
r1 = rf(ctx, p, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindByParentFolderID provides a mock function with given fields: ctx, parentFolderID
func (_m *FolderReaderWriter) FindByParentFolderID(ctx context.Context, parentFolderID models.FolderID) ([]*models.Folder, error) {
ret := _m.Called(ctx, parentFolderID)
var r0 []*models.Folder
if rf, ok := ret.Get(0).(func(context.Context, models.FolderID) []*models.Folder); ok {
r0 = rf(ctx, parentFolderID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, models.FolderID) error); ok {
r1 = rf(ctx, parentFolderID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindByPath provides a mock function with given fields: ctx, path, caseSensitive
func (_m *FolderReaderWriter) FindByPath(ctx context.Context, path string, caseSensitive bool) (*models.Folder, error) {
ret := _m.Called(ctx, path, caseSensitive)
var r0 *models.Folder
if rf, ok := ret.Get(0).(func(context.Context, string, bool) *models.Folder); ok {
r0 = rf(ctx, path, caseSensitive)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
r1 = rf(ctx, path, caseSensitive)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindByZipFileID provides a mock function with given fields: ctx, zipFileID
func (_m *FolderReaderWriter) FindByZipFileID(ctx context.Context, zipFileID models.FileID) ([]*models.Folder, error) {
ret := _m.Called(ctx, zipFileID)
var r0 []*models.Folder
if rf, ok := ret.Get(0).(func(context.Context, models.FileID) []*models.Folder); ok {
r0 = rf(ctx, zipFileID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, models.FileID) error); ok {
r1 = rf(ctx, zipFileID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindMany provides a mock function with given fields: ctx, id
func (_m *FolderReaderWriter) FindMany(ctx context.Context, id []models.FolderID) ([]*models.Folder, error) {
ret := _m.Called(ctx, id)
var r0 []*models.Folder
if rf, ok := ret.Get(0).(func(context.Context, []models.FolderID) []*models.Folder); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Folder)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, []models.FolderID) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Query provides a mock function with given fields: ctx, options
func (_m *FolderReaderWriter) Query(ctx context.Context, options models.FolderQueryOptions) (*models.FolderQueryResult, error) {
ret := _m.Called(ctx, options)
var r0 *models.FolderQueryResult
if rf, ok := ret.Get(0).(func(context.Context, models.FolderQueryOptions) *models.FolderQueryResult); ok {
r0 = rf(ctx, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.FolderQueryResult)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, models.FolderQueryOptions) error); ok {
r1 = rf(ctx, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Update provides a mock function with given fields: ctx, f
func (_m *FolderReaderWriter) Update(ctx context.Context, f *models.Folder) error {
ret := _m.Called(ctx, f)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Folder) error); ok {
r0 = rf(ctx, f)
} else {
r0 = ret.Error(0)
}
return r0
}