add mp3 file extension

This commit is contained in:
Tordarus 2025-01-15 15:01:28 +01:00
parent 1897aa3153
commit 55a7cdc36f
2 changed files with 4 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
music-library

View File

@ -65,8 +65,8 @@ func main() {
}
func TranscodeFile(file string) error {
relPath := strings.TrimPrefix(file, FlagSourceDir)
newPath := filepath.Join(FlagTargetDir, relPath)
relPath := strings.TrimPrefix(file[:len(file)-len(filepath.Ext(file))], FlagSourceDir)
newPath := filepath.Join(FlagTargetDir, relPath+".mp3")
newDir := filepath.Dir(newPath)
fmt.Printf("check '%s'\n", relPath)