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.9.28 to 2.9.29

43

dist/lib/playerstate.js

@@ -205,15 +205,14 @@ "use strict";

if (artistIds.length > 50) {
const maxArtists = 50;
let offset = 0;
let maxlen = artistIds.length / maxArtists;
if (maxlen % 1 !== 0) {
maxlen += 1;
}
for (let idx = 0; idx < maxlen; idx++) {
artistIds = artistIds.splice(offset, 50);
const batchedArtists = await this.getSpotifyArtistsByIds(artistIds);
if (batchedArtists) {
let hasData = artistIds.length ? true : false;
while (hasData) {
// keep removing from the artistIds
let splicedArtistIds = artistIds.splice(0, 50);
const batchedArtists = await this.getSpotifyArtistsByIds(splicedArtistIds);
if (batchedArtists && batchedArtists.length) {
artists.push(...batchedArtists);
}
offset += maxArtists;
hasData = artistIds.length ? true : false;
if (!hasData) {
break;
}
}

@@ -240,12 +239,16 @@ }

let genre = "";
if (t.artists &&
t.artists.length > 0 &&
t.artists[0].genres) {
// make sure we use the highest frequency genre
try {
genre = musicClient.getHighestFrequencySpotifyGenre(t.artists[0].genres);
if (t.artists && t.artists.length) {
for (let a = 0; a < t.artists.length; a++) {
const artistCandidate = t.artists[a];
if (artistCandidate.genres &&
artistCandidate.genres.length) {
try {
genre = musicClient.getHighestFrequencySpotifyGenre(artistCandidate.genres);
}
catch (e) {
//
}
break;
}
}
catch (e) {
//
}
}

@@ -252,0 +255,0 @@ if (genre) {

@@ -244,17 +244,17 @@ import { MusicUtil } from "./util";

if (artistIds.length > 50) {
const maxArtists = 50;
let offset = 0;
let maxlen = artistIds.length / maxArtists;
if (maxlen % 1 !== 0) {
maxlen += 1;
}
for (let idx = 0; idx < maxlen; idx++) {
artistIds = artistIds.splice(offset, 50);
let hasData = artistIds.length ? true : false;
while (hasData) {
// keep removing from the artistIds
let splicedArtistIds = artistIds.splice(0, 50);
const batchedArtists = await this.getSpotifyArtistsByIds(
artistIds
splicedArtistIds
);
if (batchedArtists) {
if (batchedArtists && batchedArtists.length) {
artists.push(...batchedArtists);
}
offset += maxArtists;
hasData = artistIds.length ? true : false;
if (!hasData) {
break;
}
}

@@ -286,14 +286,18 @@ } else {

let genre = "";
if (
t.artists &&
t.artists.length > 0 &&
t.artists[0].genres
) {
// make sure we use the highest frequency genre
try {
genre = musicClient.getHighestFrequencySpotifyGenre(
t.artists[0].genres
);
} catch (e) {
//
if (t.artists && t.artists.length) {
for (let a = 0; a < t.artists.length; a++) {
const artistCandidate = t.artists[a];
if (
artistCandidate.genres &&
artistCandidate.genres.length
) {
try {
genre = musicClient.getHighestFrequencySpotifyGenre(
artistCandidate.genres
);
} catch (e) {
//
}
break;
}
}

@@ -300,0 +304,0 @@ }

{
"name": "cody-music",
"version": "2.9.28",
"version": "2.9.29",
"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",

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