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:
@@ -7,8 +7,8 @@ import (
|
||||
type GalleryReader interface {
|
||||
// Find(id int) (*Gallery, error)
|
||||
FindMany(ids []int) ([]*Gallery, error)
|
||||
// FindByChecksum(checksum string) (*Gallery, error)
|
||||
// FindByPath(path string) (*Gallery, error)
|
||||
FindByChecksum(checksum string) (*Gallery, error)
|
||||
FindByPath(path string) (*Gallery, error)
|
||||
FindBySceneID(sceneID int) (*Gallery, error)
|
||||
// ValidGalleriesForScenePath(scenePath string) ([]*Gallery, error)
|
||||
// Count() (int, error)
|
||||
@@ -17,8 +17,8 @@ type GalleryReader interface {
|
||||
}
|
||||
|
||||
type GalleryWriter interface {
|
||||
// Create(newGallery Gallery) (*Gallery, error)
|
||||
// Update(updatedGallery Gallery) (*Gallery, error)
|
||||
Create(newGallery Gallery) (*Gallery, error)
|
||||
Update(updatedGallery Gallery) (*Gallery, error)
|
||||
// Destroy(id int) error
|
||||
// ClearGalleryId(sceneID int) error
|
||||
}
|
||||
@@ -44,10 +44,26 @@ func (t *galleryReaderWriter) FindMany(ids []int) ([]*Gallery, error) {
|
||||
return t.qb.FindMany(ids)
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) FindByChecksum(checksum string) (*Gallery, error) {
|
||||
return t.qb.FindByChecksum(checksum, t.tx)
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) All() ([]*Gallery, error) {
|
||||
return t.qb.All()
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) FindByPath(path string) (*Gallery, error) {
|
||||
return t.qb.FindByPath(path)
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) FindBySceneID(sceneID int) (*Gallery, error) {
|
||||
return t.qb.FindBySceneID(sceneID, t.tx)
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) Create(newGallery Gallery) (*Gallery, error) {
|
||||
return t.qb.Create(newGallery, t.tx)
|
||||
}
|
||||
|
||||
func (t *galleryReaderWriter) Update(updatedGallery Gallery) (*Gallery, error) {
|
||||
return t.qb.Update(updatedGallery, t.tx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user