Added Check for / at the end in directory names
This commit is contained in:
		
							parent
							
								
									2e1e0938c0
								
							
						
					
					
						commit
						73aebcd0a0
					
				| @ -17,10 +17,10 @@ var ( | ||||
| 		"ADDITIONAL_PADDING_Y": 16, | ||||
| 		"IMAGE_WIDTH_EXTRA_X":  -1.5, | ||||
| 		"IMAGE_WIDTH_EXTRA_Y":  -3.75, | ||||
| 		"MUSIC_DIRECTORY":      getMusicDirectory() + "/", | ||||
| 		"MUSIC_DIRECTORY":      CheckDirectoryFmt(getMusicDirectory()), | ||||
| 		"PORT":                 "6600", | ||||
| 		"DEFAULT_IMAGE_PATH":   "default.jpg", | ||||
| 		"CACHE_DIR":            USER_CACHE_DIR + "/", | ||||
| 		"CACHE_DIR":            CheckDirectoryFmt(USER_CACHE_DIR), | ||||
| 	} | ||||
| ) | ||||
| 
 | ||||
| @ -73,3 +73,11 @@ func getMusicDirectory() string { | ||||
| 	} | ||||
| 	return "" | ||||
| } | ||||
| 
 | ||||
| func CheckDirectoryFmt(path string) string { | ||||
| 	if strings.HasSuffix(path, "/") { | ||||
| 		return path | ||||
| 	} else { | ||||
| 		return path + "/" | ||||
| 	} | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user