stash/pkg/file/file.go
WithoutPants 39fdde273d
Scan refactor (#1816)
* Add file scanner
* Scan scene changes
* Split scan files
* Generalise scan
* Refactor ffprobe
* Refactor ffmpeg encoder
* Move scene scan code to scene package
* Move matchExtension to utils
* Refactor gallery scanning
* Refactor image scanning
* Prevent race conditions on identical hashes
* Refactor image thumbnail generation
* Perform count concurrently
* Allow progress increment before total set
* Make progress updates more frequent
2021-10-15 10:39:48 +11:00

31 lines
395 B
Go

package file
import (
"io"
"io/fs"
"os"
)
type fsFile struct {
path string
info fs.FileInfo
}
func (f *fsFile) Open() (io.ReadCloser, error) {
return os.Open(f.path)
}
func (f *fsFile) Path() string {
return f.path
}
func (f *fsFile) FileInfo() fs.FileInfo {
return f.info
}
func FSFile(path string, info fs.FileInfo) SourceFile {
return &fsFile{
path: path,
info: info,
}
}