]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/files.go
Fix io.Reader implementation for FileNameWithInfo
[rbdr/mobius] / hotline / files.go
index 9357bdbaef42dd151c2fe88c0a0591d177ca7c9c..0963fbfd73e50f70c7365f24c737bb07eb249fd9 100644 (file)
@@ -3,6 +3,7 @@ package hotline
 import (
        "encoding/binary"
        "errors"
+       "io"
        "io/fs"
        "os"
        "path/filepath"
@@ -123,16 +124,16 @@ func getFileNameList(path string, ignoreList []string) (fields []Field, err erro
                strippedName := strings.ReplaceAll(file.Name(), ".incomplete", "")
                strippedName, err = txtEncoder.String(strippedName)
                if err != nil {
-                       return nil, err
+                       continue
                }
 
                nameSize := make([]byte, 2)
                binary.BigEndian.PutUint16(nameSize, uint16(len(strippedName)))
                copy(fnwi.NameSize[:], nameSize)
 
-               fnwi.name = []byte(strippedName)
+               fnwi.Name = []byte(strippedName)
 
-               b, err := fnwi.MarshalBinary()
+               b, err := io.ReadAll(&fnwi)
                if err != nil {
                        return nil, err
                }