mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 20:18:07 +01:00
fix: various bugs and general code improvements
This commit is contained in:
12
lib/utils.go
12
lib/utils.go
@@ -137,7 +137,7 @@ func (app *App) InitSpotifyClient() error {
|
||||
}
|
||||
|
||||
func SpotifyUriToLink(uri string) (string, error) {
|
||||
spotifyId := strings.Split(uri, ":")
|
||||
spotifyId := strings.Split(uri, ":")
|
||||
|
||||
if len(spotifyId) != 3 {
|
||||
return "", errors.New("Invalid URI parsed.")
|
||||
@@ -145,3 +145,13 @@ func SpotifyUriToLink(uri string) (string, error) {
|
||||
|
||||
return BASE_SPOTIFY_TRACK_URL + spotifyId[2], nil
|
||||
}
|
||||
|
||||
func IsPathDirectory(path string) bool {
|
||||
pathRune := []rune(path)
|
||||
if len(pathRune) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
lastCharacter := string(pathRune[len(pathRune)-1:])
|
||||
return lastCharacter == "/"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user