cody-music
Version:
mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control
71 lines (70 loc) • 3.05 kB
TypeScript
import { CodyResponse, PlaylistItem, Track } from "./models";
export declare class PlaylistService {
private static instance;
private constructor();
static getInstance(): PlaylistService;
removeFromSpotifyLiked(trackIds: string[]): Promise<CodyResponse>;
saveToSpotifyLiked(trackIds: string[]): Promise<CodyResponse>;
getSavedTracks(qsOptions?: any): Promise<Track[]>;
getPlaylists(qsOptions?: any): Promise<PlaylistItem[]>;
getPlaylistsForUser(spotifyUserId: string, limit: number, offset: number): Promise<CodyResponse>;
getSpotifyPlaylist(playlist_id: string): Promise<PlaylistItem>;
getPlaylistTracks(playlist_id: string, qsOptions?: any): Promise<CodyResponse>;
getPlaylistNames(qsOptions?: any): Promise<string[]>;
/**
* Create a new playlist
* @param name
* @param isPublic
*/
createPlaylist(name: string, isPublic: boolean, description?: string): Promise<CodyResponse>;
deletePlaylist(playlist_id: string): Promise<CodyResponse>;
/**
* type: Valid types are: album , artist, playlist, and track
* q: can have a filter and keywords, or just keywords. You
* can have a wildcard as well. The query will search against
* the name and description if a specific filter isn't specified.
* examples:
* 1) search for a track by name "what a time to be alive"
* query string: ?q=name:what%20a%20time&type=track
* result: this should return tracks matching the track name
* 2) search for a track using a wildcard in the name
* query string: ?q=name:what*&type=track&limit=50
* result: will return all tracks with "what" in the name
* 3) search for an artist in name or description
* query string: ?tania%20bowra&type=artist
* result: will return all artists where tania bowra is in
* the name or description
* limit: max of 50
* @param type
* @param q
*/
search(type: string, q: string, limit?: number): Promise<any>;
/**
* Add tracks to a given playlist
* @param playlist_id
* @param track_ids
* @param position
*/
addTracksToPlaylist(playlist_id: string, track_ids: string[], position?: number): Promise<CodyResponse>;
/**
* Replace tracks of a given playlist. This will wipe out
* the current set of tracks.
* @param playlist_id
* @param track_ids
*/
replacePlaylistTracks(playlist_id: string, track_ids: string[]): Promise<CodyResponse>;
/**
* Track IDs should be the uri (i.e. "spotify:track:4iV5W9uYEdYUVa79Axb7Rh")
* but if it's only the id (i.e. "4iV5W9uYEdYUVa79Axb7Rh") this will add
* the uri part "spotify:track:"
* @param playlist_id
* @param trackIds
*/
removeTracksFromPlaylist(playlist_id: string, track_ids: string[]): Promise<CodyResponse>;
getTopSpotifyTracks(): Promise<Track[]>;
/**
* follow a playlist
* @param playlist_id
*/
followPlaylist(playlist_id: string): Promise<CodyResponse>;
}