Fix HLS streaming and cleanup on diskfs

This commit is contained in:
Ingo Oppermann
2022-09-08 15:00:09 +02:00
parent ed36f45f5f
commit f1d71c202b
7 changed files with 248 additions and 50 deletions

View File

@@ -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
}