mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add partial import functionality (#812)
This commit is contained in:
@@ -9,7 +9,7 @@ type StudioReader interface {
|
||||
FindMany(ids []int) ([]*Studio, error)
|
||||
// FindChildren(id int) ([]*Studio, error)
|
||||
// FindBySceneID(sceneID int) (*Studio, error)
|
||||
// FindByName(name string, nocase bool) (*Studio, error)
|
||||
FindByName(name string, nocase bool) (*Studio, error)
|
||||
// Count() (int, error)
|
||||
All() ([]*Studio, error)
|
||||
// AllSlim() ([]*Studio, error)
|
||||
@@ -18,10 +18,11 @@ type StudioReader interface {
|
||||
}
|
||||
|
||||
type StudioWriter interface {
|
||||
// Create(newStudio Studio) (*Studio, error)
|
||||
// Update(updatedStudio StudioPartial) (*Studio, error)
|
||||
Create(newStudio Studio) (*Studio, error)
|
||||
Update(updatedStudio StudioPartial) (*Studio, error)
|
||||
UpdateFull(updatedStudio Studio) (*Studio, error)
|
||||
// Destroy(id string) error
|
||||
// UpdateStudioImage(studioID int, image []byte) error
|
||||
UpdateStudioImage(studioID int, image []byte) error
|
||||
// DestroyStudioImage(studioID int) error
|
||||
}
|
||||
|
||||
@@ -50,6 +51,10 @@ func (t *studioReaderWriter) FindMany(ids []int) ([]*Studio, error) {
|
||||
return t.qb.FindMany(ids)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) FindByName(name string, nocase bool) (*Studio, error) {
|
||||
return t.qb.FindByName(name, t.tx, nocase)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) All() ([]*Studio, error) {
|
||||
return t.qb.All()
|
||||
}
|
||||
@@ -57,3 +62,19 @@ func (t *studioReaderWriter) All() ([]*Studio, error) {
|
||||
func (t *studioReaderWriter) GetStudioImage(studioID int) ([]byte, error) {
|
||||
return t.qb.GetStudioImage(studioID, t.tx)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) Create(newStudio Studio) (*Studio, error) {
|
||||
return t.qb.Create(newStudio, t.tx)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) Update(updatedStudio StudioPartial) (*Studio, error) {
|
||||
return t.qb.Update(updatedStudio, t.tx)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) UpdateFull(updatedStudio Studio) (*Studio, error) {
|
||||
return t.qb.UpdateFull(updatedStudio, t.tx)
|
||||
}
|
||||
|
||||
func (t *studioReaderWriter) UpdateStudioImage(studioID int, image []byte) error {
|
||||
return t.qb.UpdateStudioImage(studioID, image, t.tx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user