fix: various bugs and general code improvements

This commit is contained in:
2026-02-28 16:18:50 +01:00
parent 2fea9a79df
commit fcae48753b
6 changed files with 68 additions and 47 deletions

View File

@@ -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 == "/"
}