deletePlaylist
This commit is contained in:
@@ -14,6 +14,7 @@ type ItunesControl interface {
|
||||
SetTrackRating(trackId string, rating int) error
|
||||
SetAlbumRating(trackId string, rating int) error
|
||||
CreatePlaylist(name string, ids []string) (string, error)
|
||||
DeletePlaylist(id string) error
|
||||
}
|
||||
|
||||
func NewItunesControl() ItunesControl {
|
||||
@@ -39,6 +40,14 @@ func (c *itunesControl) CreatePlaylist(name string, ids []string) (string, error
|
||||
return strings.TrimSuffix(pid, "\n"), nil
|
||||
}
|
||||
|
||||
func (c *itunesControl) DeletePlaylist(id string) error {
|
||||
script := Script{
|
||||
fmt.Sprintf(`set pls to the first item of (every playlist whose persistent ID is equal to "%s")`, id),
|
||||
`delete pls`,
|
||||
}
|
||||
return script.Run()
|
||||
}
|
||||
|
||||
func (c *itunesControl) MarkAsPlayed(trackId string, playDate time.Time) error {
|
||||
script := Script{fmt.Sprintf(
|
||||
`set theTrack to the first item of (every track whose persistent ID is equal to "%s")`, trackId),
|
||||
|
||||
Reference in New Issue
Block a user