feat: begin working on the categorize

This commit is contained in:
DaanSelen
2026-04-23 16:57:58 +02:00
parent 417cecf43f
commit 24be1cedeb
6 changed files with 50 additions and 43 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ import (
)
func RegisterFileRoutes(file *gin.RouterGroup, env bootstrap.Environment, db *gorm.DB) {
// /file/<file-name>
// prefix: file
// for example: /file/<file-name>
file.GET("/:filename", func(c *gin.Context) {
f := c.Param("filename")
p := filepath.Join(env.ContentDirectory, f)
+1 -1
View File
@@ -19,7 +19,7 @@ func BuildFileRecord(r io.Reader, origName string, contentDirectory string) (Fil
return File{}, fmt.Errorf("unsupported filetype")
}
checksum, err := utility.HashReader(r)
checksum, err := utility.GenerateHashFromReader(r)
if err != nil {
slog.Error("failed to calculate hash of file at given path", "error", err)
return File{}, err