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 { | func TranscodeFile(file string) error { | ||||||
| 	relPath := strings.TrimPrefix(file, FlagSourceDir) | 	relPath := strings.TrimPrefix(file[:len(file)-len(filepath.Ext(file))], FlagSourceDir) | ||||||
| 	newPath := filepath.Join(FlagTargetDir, relPath) | 	newPath := filepath.Join(FlagTargetDir, relPath+".mp3") | ||||||
| 	newDir := filepath.Dir(newPath) | 	newDir := filepath.Dir(newPath) | ||||||
|  |  | ||||||
| 	fmt.Printf("check '%s'\n", relPath) | 	fmt.Printf("check '%s'\n", relPath) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user