refactor: replace fileutil with fsutil and local hashing

This commit is contained in:
Mathis Maquenne
2026-08-05 11:42:35 +02:00
parent 12dbbb5e10
commit dbb808f371
9 changed files with 110 additions and 119 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ package downloader
import (
"context"
"github.com/mathismqn/godeez/internal/fileutil"
"github.com/mathismqn/godeez/internal/fsutil"
)
func (c *Client) shouldSkipDownload(ctx context.Context, trackID, mediaFormat string) (string, bool) {
@@ -12,7 +12,7 @@ func (c *Client) shouldSkipDownload(ctx context.Context, trackID, mediaFormat st
return "", false
}
if fileutil.FileExists(existing.Path) {
if fsutil.Exists(existing.Path) {
return existing.Path, true
}
@@ -24,7 +24,7 @@ func (c *Client) shouldSkipDownload(ctx context.Context, trackID, mediaFormat st
return "", false
}
foundPath, ok := c.hashIndex.Find(existing.Hash)
foundPath, ok := c.hashIndex.find(existing.Hash)
if !ok {
return "", false
}