node build fixed
This commit is contained in:
28
seanime-2.9.10/internal/library/scanner/localfile.go
Normal file
28
seanime-2.9.10/internal/library/scanner/localfile.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package scanner
|
||||
|
||||
import (
|
||||
"github.com/rs/zerolog"
|
||||
lop "github.com/samber/lo/parallel"
|
||||
"seanime/internal/library/anime"
|
||||
"seanime/internal/library/filesystem"
|
||||
)
|
||||
|
||||
// GetLocalFilesFromDir creates a new LocalFile for each video file
|
||||
func GetLocalFilesFromDir(dirPath string, logger *zerolog.Logger) ([]*anime.LocalFile, error) {
|
||||
paths, err := filesystem.GetMediaFilePathsFromDirS(dirPath)
|
||||
|
||||
logger.Trace().
|
||||
Any("dirPath", dirPath).
|
||||
Msg("localfile: Retrieving and creating local files")
|
||||
|
||||
// Concurrently populate localFiles
|
||||
localFiles := lop.Map(paths, func(path string, index int) *anime.LocalFile {
|
||||
return anime.NewLocalFile(path, dirPath)
|
||||
})
|
||||
|
||||
logger.Trace().
|
||||
Any("count", len(localFiles)).
|
||||
Msg("localfile: Retrieved local files")
|
||||
|
||||
return localFiles, err
|
||||
}
|
||||
Reference in New Issue
Block a user