mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
Fix HLS streaming and cleanup on diskfs
This commit is contained in:
@@ -291,11 +291,19 @@ func (fs *diskFilesystem) List(pattern string) []FileInfo {
|
||||
files := []FileInfo{}
|
||||
|
||||
fs.walk(func(path string, info os.FileInfo) {
|
||||
if path == fs.dir {
|
||||
return
|
||||
}
|
||||
|
||||
name := strings.TrimPrefix(path, fs.dir)
|
||||
if name[0] != os.PathSeparator {
|
||||
name = string(os.PathSeparator) + name
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
name += "/"
|
||||
}
|
||||
|
||||
if len(pattern) != 0 {
|
||||
if ok, _ := glob.Match(pattern, name, '/'); !ok {
|
||||
return
|
||||
@@ -319,6 +327,7 @@ func (fs *diskFilesystem) walk(walkfn func(path string, info os.FileInfo)) {
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
walkfn(path, info)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user