mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Movies Section (#338)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -265,6 +265,7 @@ const (
|
||||
XPathScraperConfigSceneTags = "Tags"
|
||||
XPathScraperConfigScenePerformers = "Performers"
|
||||
XPathScraperConfigSceneStudio = "Studio"
|
||||
XPathScraperConfigSceneMovies = "Movies"
|
||||
)
|
||||
|
||||
func (s xpathScraper) GetSceneSimple() xpathScraperConfig {
|
||||
@@ -274,7 +275,7 @@ func (s xpathScraper) GetSceneSimple() xpathScraperConfig {
|
||||
|
||||
if mapped != nil {
|
||||
for k, v := range mapped {
|
||||
if k != XPathScraperConfigSceneTags && k != XPathScraperConfigScenePerformers && k != XPathScraperConfigSceneStudio {
|
||||
if k != XPathScraperConfigSceneTags && k != XPathScraperConfigScenePerformers && k != XPathScraperConfigSceneStudio && k != XPathScraperConfigSceneMovies {
|
||||
ret[k] = v
|
||||
}
|
||||
}
|
||||
@@ -313,6 +314,10 @@ func (s xpathScraper) GetSceneStudio() xpathScraperConfig {
|
||||
return s.getSceneSubMap(XPathScraperConfigSceneStudio)
|
||||
}
|
||||
|
||||
func (s xpathScraper) GetSceneMovies() xpathScraperConfig {
|
||||
return s.getSceneSubMap(XPathScraperConfigSceneMovies)
|
||||
}
|
||||
|
||||
func (s xpathScraper) scrapePerformer(doc *html.Node) (*models.ScrapedPerformer, error) {
|
||||
var ret models.ScrapedPerformer
|
||||
|
||||
@@ -358,6 +363,7 @@ func (s xpathScraper) scrapeScene(doc *html.Node) (*models.ScrapedScene, error)
|
||||
scenePerformersMap := s.GetScenePerformers()
|
||||
sceneTagsMap := s.GetSceneTags()
|
||||
sceneStudioMap := s.GetSceneStudio()
|
||||
sceneMoviesMap := s.GetSceneMovies()
|
||||
|
||||
results := sceneMap.process(doc, s.Common)
|
||||
if len(results) > 0 {
|
||||
@@ -393,6 +399,17 @@ func (s xpathScraper) scrapeScene(doc *html.Node) (*models.ScrapedScene, error)
|
||||
ret.Studio = studio
|
||||
}
|
||||
}
|
||||
|
||||
if sceneMoviesMap != nil {
|
||||
movieResults := sceneMoviesMap.process(doc, s.Common)
|
||||
|
||||
for _, p := range movieResults {
|
||||
movie := &models.ScrapedSceneMovie{}
|
||||
p.apply(movie)
|
||||
ret.Movies = append(ret.Movies, movie)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return &ret, nil
|
||||
|
||||
Reference in New Issue
Block a user