code and layout refactoring

This commit is contained in:
2024-03-26 10:10:27 +01:00
parent 82ccb68a56
commit c6e48f4baa
11 changed files with 143 additions and 147 deletions

View File

@@ -1,8 +1,6 @@
package utils
import (
"crypto/sha256"
"encoding/hex"
"io/fs"
"regexp"
"strings"
@@ -21,9 +19,3 @@ func IsValidEntry(d fs.DirEntry) bool {
!strings.HasSuffix(d.Name(), ".part") &&
!strings.HasSuffix(d.Name(), ".ytdl")
}
func ShaSumString(path string) string {
h := sha256.New()
h.Write([]byte(path))
return hex.EncodeToString(h.Sum(nil))
}