mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Data layer restructuring (#997)
* Move query builders to sqlite package * Add transaction system * Wrap model resolvers in transaction * Add error return value for StringSliceToIntSlice * Update/refactor mutation resolvers * Convert query builders * Remove unused join types * Add stash id unit tests * Use WAL journal mode
This commit is contained in:
@@ -15,13 +15,15 @@ type jsonScraper struct {
|
||||
scraper scraperTypeConfig
|
||||
config config
|
||||
globalConfig GlobalConfig
|
||||
txnManager models.TransactionManager
|
||||
}
|
||||
|
||||
func newJsonScraper(scraper scraperTypeConfig, config config, globalConfig GlobalConfig) *jsonScraper {
|
||||
func newJsonScraper(scraper scraperTypeConfig, txnManager models.TransactionManager, config config, globalConfig GlobalConfig) *jsonScraper {
|
||||
return &jsonScraper{
|
||||
scraper: scraper,
|
||||
config: config,
|
||||
globalConfig: globalConfig,
|
||||
txnManager: txnManager,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +140,7 @@ func (s *jsonScraper) scrapePerformerByFragment(scrapedPerformer models.ScrapedP
|
||||
}
|
||||
|
||||
func (s *jsonScraper) scrapeSceneByFragment(scene models.SceneUpdateInput) (*models.ScrapedScene, error) {
|
||||
storedScene, err := sceneFromUpdateFragment(scene)
|
||||
storedScene, err := sceneFromUpdateFragment(scene, s.txnManager)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -171,7 +173,7 @@ func (s *jsonScraper) scrapeSceneByFragment(scene models.SceneUpdateInput) (*mod
|
||||
}
|
||||
|
||||
func (s *jsonScraper) scrapeGalleryByFragment(gallery models.GalleryUpdateInput) (*models.ScrapedGallery, error) {
|
||||
storedGallery, err := galleryFromUpdateFragment(gallery)
|
||||
storedGallery, err := galleryFromUpdateFragment(gallery, s.txnManager)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user