mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 20:18:07 +01:00
fix: remove spotiflac libraries
This commit is contained in:
25
lib/utils.go
Normal file
25
lib/utils.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package pkg
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type UrlType int
|
||||
|
||||
const (
|
||||
UrlTypeTrack UrlType = iota
|
||||
UrlTypePlaylist
|
||||
UrlTypeInvalid
|
||||
)
|
||||
|
||||
func GetUrlType(url string) UrlType {
|
||||
if strings.Contains(url, "https://open.spotify.com/track") {
|
||||
return UrlTypeTrack
|
||||
}
|
||||
|
||||
if strings.Contains(url, "https://open.spotify.com/playlist") {
|
||||
return UrlTypePlaylist
|
||||
}
|
||||
|
||||
return UrlTypeInvalid
|
||||
}
|
||||
Reference in New Issue
Block a user