mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Restructure data layer (#2532)
* Add new txn manager interface * Add txn management to sqlite * Rename get to getByID * Add contexts to repository methods * Update query builders * Add context to reader writer interfaces * Use repository in resolver * Tighten interfaces * Tighten interfaces in dlna * Tighten interfaces in match package * Tighten interfaces in scraper package * Tighten interfaces in scan code * Tighten interfaces on autotag package * Remove ReaderWriter usage * Merge database package into sqlite
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
package mocks
|
||||
|
||||
import "github.com/stashapp/stash/pkg/models"
|
||||
import (
|
||||
context "context"
|
||||
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
)
|
||||
|
||||
type sceneResolver struct {
|
||||
scenes []*models.Scene
|
||||
}
|
||||
|
||||
func (s *sceneResolver) Find(id int) (*models.Scene, error) {
|
||||
func (s *sceneResolver) Find(ctx context.Context, id int) (*models.Scene, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (s *sceneResolver) FindMany(ids []int) ([]*models.Scene, error) {
|
||||
func (s *sceneResolver) FindMany(ctx context.Context, ids []int) ([]*models.Scene, error) {
|
||||
return s.scenes, nil
|
||||
}
|
||||
|
||||
@@ -27,7 +31,7 @@ type imageResolver struct {
|
||||
images []*models.Image
|
||||
}
|
||||
|
||||
func (s *imageResolver) FindMany(ids []int) ([]*models.Image, error) {
|
||||
func (s *imageResolver) FindMany(ctx context.Context, ids []int) ([]*models.Image, error) {
|
||||
return s.images, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user