add mp3 file extension
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| .env | ||||
| music-library | ||||
							
								
								
									
										4
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
									
									
									
									
								
							| @ -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) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user