mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 21:03:22 +01:00
Find scrapers in subdirectories (#554)
This commit is contained in:
parent
5450fe8e9a
commit
05488d59c3
1 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package scraper
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
|
|
@ -21,7 +22,13 @@ func loadScrapers() ([]scraperConfig, error) {
|
|||
scrapers = make([]scraperConfig, 0)
|
||||
|
||||
logger.Debugf("Reading scraper configs from %s", path)
|
||||
scraperFiles, err := filepath.Glob(filepath.Join(path, "*.yml"))
|
||||
scraperFiles := []string{}
|
||||
err := filepath.Walk(path, func(fp string, f os.FileInfo, err error) error {
|
||||
if filepath.Ext(fp) == ".yml" {
|
||||
scraperFiles = append(scraperFiles, fp)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
logger.Errorf("Error reading scraper configs: %s", err.Error())
|
||||
|
|
|
|||
Loading…
Reference in a new issue