Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cody-music

Package Overview
Dependencies
Maintainers
1
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cody-music - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

20

lib/playlist.ts

@@ -32,10 +32,16 @@ import { MusicClient } from "./client";

}/playlists?limit=50`;
let spotifyPlaylists = await musicClient.spotifyApiGet(api, {});
if (
spotifyPlaylists &&
spotifyPlaylists.data &&
spotifyPlaylists.data.items
) {
playlists = spotifyPlaylists.data.items;
let codyResp: CodyResponse = await musicClient.spotifyApiGet(
api,
{}
);
// check if the token needs to be refreshed
if (codyResp.statusText === "EXPIRED") {
// refresh the token
await musicClient.refreshSpotifyToken();
// try again
codyResp = await musicClient.spotifyApiGet(api, {});
}
if (codyResp && codyResp.data && codyResp.data.items) {
playlists = codyResp.data.items;
}
}

@@ -42,0 +48,0 @@

{
"name": "cody-music",
"version": "2.0.9",
"version": "2.1.0",
"description": "mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -62,3 +62,3 @@ # cody-music

await CodyMusic.playTrack(
"Spotify",
"spotify",
"spotify:track:2YarjDYjBJuH63dUIh9OWv"

@@ -70,3 +70,3 @@ ).then(result => {

// play an iTunes track number
await CodyMusic.playTrack("iTunes", 1).then(result => {
await CodyMusic.playTrack("itunes", 1).then(result => {
// track is playing

@@ -76,3 +76,3 @@ });

// handling errors
await CodyMusic.playTrack("iTunes", 1000000000).then(result => {
await CodyMusic.playTrack("spotify", 1000000000).then(result => {
// result will contain the "error" attribute with the error message

@@ -83,2 +83,6 @@ if (result.error) {

});
await CodyMusic.getRunningTrack().then(result => {
// result will be the best effort track that is playing.
// i.e. if you have your itunes app running, it would show you that track
});
```

@@ -272,2 +276,8 @@

/**
* Returns the playlists for a given player
* @param player {spotify|spotify-web|itunes}
*/
getPlaylists(player: PlayerName): Promise<PlaylistItem[]>
/**
* Get the full list of the playlist names for a given player

@@ -274,0 +284,0 @@ * @param player {spotify|spotify-web|itunes}

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc