Stash-Box Performer Tagger (#1277)

* Add bulk stash-box performer task
* Add stash-box performer scraper to scrape with menu
This commit is contained in:
InfiniteTF
2021-05-03 06:21:20 +02:00
committed by GitHub
parent a3609079bb
commit 896c3874af
46 changed files with 2311 additions and 292 deletions

View File

@@ -88,7 +88,7 @@ func (r *queryResolver) ScrapeMovieURL(ctx context.Context, url string) (*models
return manager.GetInstance().ScraperCache.ScrapeMovieURL(url)
}
func (r *queryResolver) QueryStashBoxScene(ctx context.Context, input models.StashBoxQueryInput) ([]*models.ScrapedScene, error) {
func (r *queryResolver) QueryStashBoxScene(ctx context.Context, input models.StashBoxSceneQueryInput) ([]*models.ScrapedScene, error) {
boxes := config.GetInstance().GetStashBoxes()
if input.StashBoxIndex < 0 || input.StashBoxIndex >= len(boxes) {
@@ -107,3 +107,23 @@ func (r *queryResolver) QueryStashBoxScene(ctx context.Context, input models.Sta
return nil, nil
}
func (r *queryResolver) QueryStashBoxPerformer(ctx context.Context, input models.StashBoxPerformerQueryInput) ([]*models.StashBoxPerformerQueryResult, error) {
boxes := config.GetInstance().GetStashBoxes()
if input.StashBoxIndex < 0 || input.StashBoxIndex >= len(boxes) {
return nil, fmt.Errorf("invalid stash_box_index %d", input.StashBoxIndex)
}
client := stashbox.NewClient(*boxes[input.StashBoxIndex], r.txnManager)
if len(input.PerformerIds) > 0 {
return client.FindStashBoxPerformersByNames(input.PerformerIds)
}
if input.Q != nil {
return client.QueryStashBoxPerformer(*input.Q)
}
return nil, nil
}