mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
* Rename Movie and MoviePartial to Group/GroupPartial * Rename Movie interfaces * Update movie url builders to use group * Rename movieRoutes to groupRoutes * Update dataloader * Update names in sqlite package * Rename in resolvers * Add GroupByURL to scraper config * Scraper backward compatibility hacks
42 lines
1 KiB
Go
42 lines
1 KiB
Go
package models
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/stashapp/stash/pkg/txn"
|
|
)
|
|
|
|
type TxnManager interface {
|
|
txn.Manager
|
|
txn.DatabaseProvider
|
|
}
|
|
|
|
type Repository struct {
|
|
TxnManager TxnManager
|
|
|
|
Blob BlobReader
|
|
File FileReaderWriter
|
|
Folder FolderReaderWriter
|
|
Gallery GalleryReaderWriter
|
|
GalleryChapter GalleryChapterReaderWriter
|
|
Image ImageReaderWriter
|
|
Group GroupReaderWriter
|
|
Performer PerformerReaderWriter
|
|
Scene SceneReaderWriter
|
|
SceneMarker SceneMarkerReaderWriter
|
|
Studio StudioReaderWriter
|
|
Tag TagReaderWriter
|
|
SavedFilter SavedFilterReaderWriter
|
|
}
|
|
|
|
func (r *Repository) WithTxn(ctx context.Context, fn txn.TxnFunc) error {
|
|
return txn.WithTxn(ctx, r.TxnManager, fn)
|
|
}
|
|
|
|
func (r *Repository) WithReadTxn(ctx context.Context, fn txn.TxnFunc) error {
|
|
return txn.WithReadTxn(ctx, r.TxnManager, fn)
|
|
}
|
|
|
|
func (r *Repository) WithDB(ctx context.Context, fn txn.TxnFunc) error {
|
|
return txn.WithDatabase(ctx, r.TxnManager, fn)
|
|
}
|