mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Model refactor, part 3 (#4152)
* Remove manager.Repository * Refactor other repositories * Fix tests and add database mock * Add AssertExpectations method * Refactor routes * Move default movie image to internal/static and add convenience methods * Refactor default performer image boxes
This commit is contained in:
@@ -112,7 +112,8 @@ func (s *Manager) Import(ctx context.Context) (int, error) {
|
||||
|
||||
j := job.MakeJobExec(func(ctx context.Context, progress *job.Progress) {
|
||||
task := ImportTask{
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
resetter: s.Database,
|
||||
BaseDir: metadataPath,
|
||||
Reset: true,
|
||||
DuplicateBehaviour: ImportDuplicateEnumFail,
|
||||
@@ -136,7 +137,7 @@ func (s *Manager) Export(ctx context.Context) (int, error) {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
task := ExportTask{
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
full: true,
|
||||
fileNamingAlgorithm: config.GetVideoFileNamingAlgorithm(),
|
||||
}
|
||||
@@ -167,7 +168,7 @@ func (s *Manager) Generate(ctx context.Context, input GenerateMetadataInput) (in
|
||||
}
|
||||
|
||||
j := &GenerateJob{
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
input: input,
|
||||
}
|
||||
|
||||
@@ -212,7 +213,7 @@ func (s *Manager) generateScreenshot(ctx context.Context, sceneId string, at *fl
|
||||
}
|
||||
|
||||
task := GenerateCoverTask{
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
Scene: *scene,
|
||||
ScreenshotAt: at,
|
||||
Overwrite: true,
|
||||
@@ -239,7 +240,7 @@ type AutoTagMetadataInput struct {
|
||||
|
||||
func (s *Manager) AutoTag(ctx context.Context, input AutoTagMetadataInput) int {
|
||||
j := autoTagJob{
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
input: input,
|
||||
}
|
||||
|
||||
@@ -255,7 +256,7 @@ type CleanMetadataInput struct {
|
||||
func (s *Manager) Clean(ctx context.Context, input CleanMetadataInput) int {
|
||||
j := cleanJob{
|
||||
cleaner: s.Cleaner,
|
||||
txnManager: s.Repository,
|
||||
repository: s.Repository,
|
||||
sceneService: s.SceneService,
|
||||
imageService: s.ImageService,
|
||||
input: input,
|
||||
|
||||
Reference in New Issue
Block a user