forked from go/golangs_learn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
560 B
24 lines
560 B
3 years ago
|
package models
|
||
|
|
||
|
type GenericPlaylist struct {
|
||
|
ID string `json:"id"`
|
||
|
Url string `json:"url"`
|
||
|
TracksCount int `json:"count"`
|
||
|
Name string `json:"name"`
|
||
|
Thumbnails string `json:"thumbnail"`
|
||
|
TracksIds []string `json:"tracksIds"`
|
||
|
}
|
||
|
|
||
|
func NewGenericPlaylist(id string, name string, playlistSize int, tracks []string) GenericPlaylist {
|
||
|
return GenericPlaylist{
|
||
|
ID: id,
|
||
|
Name: name,
|
||
|
TracksCount: playlistSize,
|
||
|
TracksIds: tracks,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (s GenericPlaylist) isEmpty() bool {
|
||
|
return s.ID == ""
|
||
|
}
|