remove hash requirement

This commit is contained in:
2024-06-04 22:19:50 -06:00
parent 9238d80d89
commit 6507518cd7

View File

@ -3,7 +3,6 @@ package source
import (
"fmt"
"forever-files/db"
"forever-files/fileUtilities"
"forever-files/types"
"log"
"os"
@ -45,18 +44,19 @@ func walkDir(dirPath string, db db.DB) error {
log.Default().Printf("error getting file info: %v", err)
continue
}
hash, err := fileUtilities.HashFile(path.Join(dirPath, entry.Name()))
if err != nil {
log.Default().Printf("error hashing file: %v", err)
continue
}
//hash, err := fileUtilities.HashFile(path.Join(dirPath, entry.Name()))
//if err != nil {
// log.Default().Printf("error hashing file: %v", err)
// continue
//}
// store info
//fmt.Printf("Name: %v, Size: %v, Modified Date: %v, Hash: %v\n", fileInfo.Name(), fileInfo.Size(), fileInfo.ModTime(), hash)
err = db.StoreFile(types.FileMetadata{
Name: fileInfo.Name(),
Path: dirPath,
Size: fileInfo.Size(),
Hash: hash,
Name: fileInfo.Name(),
Path: dirPath,
Size: fileInfo.Size(),
Hash: []byte("test"),
//Hash: hash,
ModifiedDate: fileInfo.ModTime(),
BackedUp: false,
})