func filterSceneTags(scenes []*models.ScrapedScene) {
	excludePatterns := manager.GetInstance().Config.GetScraperExcludeTagPatterns()
	var excludeRegexps []*regexp.Regexp

	for _, excludePattern := range excludePatterns {
		reg, err := regexp.Compile(strings.ToLower(excludePattern))
		if err != nil {
			logger.Errorf("Invalid tag exclusion pattern: %v", err)
		} else {
			excludeRegexps = append(excludeRegexps, reg)
		}
	}

	if len(excludeRegexps) == 0 {
		return
	}

	var ignoredTags []string

	for _, s := range scenes {
		var newTags []*models.ScrapedTag
		for _, t := range s.Tags {
			ignore := false
			for _, reg := range excludeRegexps {
				if reg.MatchString(strings.ToLower(t.Name)) {
					ignore = true
					ignoredTags = stringslice.StrAppendUnique(ignoredTags, t.Name)
					break
				}
			}

			if !ignore {
				newTags = append(newTags, t)
			}
		}

		s.Tags = newTags
	}

	if len(ignoredTags) > 0 {
		logger.Debugf("Scraping ignored tags: %s", strings.Join(ignoredTags, ", "))
	}
}
// filterSceneTags removes tags matching excluded tag patterns from the provided scraped scenes
filterSceneTags removes tags matching excluded tag patterns from the provided scraped scenes
// filterSceneTags removes tags matching excluded tag patterns from the provided scraped scenes
func filterSceneTags(scenes []*models.ScrapedScene) {
	excludePatterns := manager.GetInstance().Config.GetScraperExcludeTagPatterns()
	var excludeRegexps []*regexp.Regexp
	for _, excludePattern := range excludePatterns {
		reg, err := regexp.Compile(strings.ToLower(excludePattern))
		if err != nil {
			logger.Errorf("Invalid tag exclusion pattern: %v", err)
		} else {
			excludeRegexps = append(excludeRegexps, reg)
		}
	}
	if len(excludeRegexps) == 0 {
		return
	}
	var ignoredTags []string
	for _, s := range scenes {
		var newTags []*models.ScrapedTag
		for _, t := range s.Tags {
			ignore := false
			for _, reg := range excludeRegexps {
				if reg.MatchString(strings.ToLower(t.Name)) {
					ignore = true
					ignoredTags = stringslice.StrAppendUnique(ignoredTags, t.Name)
					break
				}
			}
			if !ignore {
				newTags = append(newTags, t)
			}
		}
		s.Tags = newTags
	}
	if len(ignoredTags) > 0 {
		logger.Debugf("Scraping ignored tags: %s", strings.Join(ignoredTags, ", "))
	}
}
func filterSceneTags ( scenes [ ] * models . ScrapedScene ) { excludePatterns := manager . GetInstance ( ) . Config . GetScraperExcludeTagPatterns ( ) var excludeRegexps [ ] * regexp . Regexp for _ , excludePattern := range excludePatterns { reg , err := regexp . Compile ( strings . ToLower ( excludePattern ) ) if err != nil { logger . Errorf ( " " , err ) } else { excludeRegexps = append ( excludeRegexps , reg ) } } if len ( excludeRegexps ) == 0 { return } var ignoredTags [ ] string for _ , s := range scenes { var newTags [ ] * models . ScrapedTag for _ , t := range s . Tags { ignore := false for _ , reg := range excludeRegexps { if reg . MatchString ( strings . ToLower ( t . Name ) ) { ignore = true ignoredTags = stringslice . StrAppendUnique ( ignoredTags , t . Name ) break } } if ! ignore { newTags = append ( newTags , t ) } } s . Tags = newTags } if len ( ignoredTags ) > 0 { logger . Debugf ( " " , strings . Join ( ignoredTags , " " ) ) } }
filterSceneTags removes tags matching excluded tag patterns from the provided scraped scenes
filterSceneTags removes tags matching excluded tag patterns from the provided scraped scenes