mirror of
https://github.com/stashapp/stash.git
synced 2026-03-02 19:25:51 +01:00
* Add basename field to folder * Add parent_folders field to folder * Add basename column to folder table * Add basename filter field * Create missing folder hierarchies during migration * Treat files/folders in zips where path can't be made relative as not found Addresses an issue during clean where corrupt folder entries in zip files could not be removed due to an error during the call to Rel.
262 lines
6.7 KiB
Go
262 lines
6.7 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
|
|
}
|
|
|
|
// GetManyParentFolderIDs provides a mock function with given fields: ctx, folderIDs
|
|
func (_m *FolderReaderWriter) GetManyParentFolderIDs(ctx context.Context, folderIDs []models.FolderID) ([][]models.FolderID, error) {
|
|
ret := _m.Called(ctx, folderIDs)
|
|
|
|
var r0 [][]models.FolderID
|
|
if rf, ok := ret.Get(0).(func(context.Context, []models.FolderID) [][]models.FolderID); ok {
|
|
r0 = rf(ctx, folderIDs)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([][]models.FolderID)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, []models.FolderID) error); ok {
|
|
r1 = rf(ctx, folderIDs)
|
|
} 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
|
|
}
|