mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +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:
@@ -19,13 +19,15 @@ type xpathScraper struct {
|
||||
scraper scraperTypeConfig
|
||||
config config
|
||||
globalConfig GlobalConfig
|
||||
txnManager models.TransactionManager
|
||||
}
|
||||
|
||||
func newXpathScraper(scraper scraperTypeConfig, config config, globalConfig GlobalConfig) *xpathScraper {
|
||||
func newXpathScraper(scraper scraperTypeConfig, txnManager models.TransactionManager, config config, globalConfig GlobalConfig) *xpathScraper {
|
||||
return &xpathScraper{
|
||||
scraper: scraper,
|
||||
config: config,
|
||||
globalConfig: globalConfig,
|
||||
txnManager: txnManager,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ func (s *xpathScraper) scrapePerformerByFragment(scrapedPerformer models.Scraped
|
||||
}
|
||||
|
||||
func (s *xpathScraper) scrapeSceneByFragment(scene models.SceneUpdateInput) (*models.ScrapedScene, error) {
|
||||
storedScene, err := sceneFromUpdateFragment(scene)
|
||||
storedScene, err := sceneFromUpdateFragment(scene, s.txnManager)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -152,7 +154,7 @@ func (s *xpathScraper) scrapeSceneByFragment(scene models.SceneUpdateInput) (*mo
|
||||
}
|
||||
|
||||
func (s *xpathScraper) 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