cody-music
Advanced tools
Comparing version 2.6.90 to 2.6.91
@@ -13,2 +13,4 @@ import { PlayerName } from "./models"; | ||
startPlayer(player: string, options?: any): Promise<any>; | ||
startMacPlayer(player: string, options?: any): Promise<any>; | ||
startWindowsPlayer(player: string, options?: any): Promise<any>; | ||
execScript(player: string, scriptName: string, params?: any, argv?: any): Promise<any>; | ||
@@ -15,0 +17,0 @@ run(player: PlayerName, scriptName: string, params?: any, argv?: any): Promise<any>; |
@@ -122,5 +122,8 @@ "use strict"; | ||
async startPlayer(player, options = {}) { | ||
if (!musicUtil.isMac()) { | ||
return ""; | ||
if (musicUtil.isWindows()) { | ||
return await this.startWindowsPlayer(player, options); | ||
} | ||
return await this.startMacPlayer(player, options); | ||
} | ||
async startMacPlayer(player, options = {}) { | ||
player = musicUtil.getPlayerName(player); | ||
@@ -140,2 +143,10 @@ let quietly = true; | ||
} | ||
async startWindowsPlayer(player, options = {}) { | ||
const command = "cmd /c spotify.exe"; | ||
let result = await musicUtil.execCmd(command); | ||
if (result === null || result === undefined || result === "") { | ||
result = "ok"; | ||
} | ||
return result; | ||
} | ||
async execScript(player, scriptName, params = null, argv = null) { | ||
@@ -142,0 +153,0 @@ player = musicUtil.getPlayerName(player); |
@@ -139,6 +139,9 @@ import { MusicUtil } from "./util"; | ||
async startPlayer(player: string, options: any = {}) { | ||
if (!musicUtil.isMac()) { | ||
return ""; | ||
if (musicUtil.isWindows()) { | ||
return await this.startWindowsPlayer(player, options); | ||
} | ||
return await this.startMacPlayer(player, options); | ||
} | ||
async startMacPlayer(player: string, options: any = {}) { | ||
player = musicUtil.getPlayerName(player); | ||
@@ -162,2 +165,11 @@ let quietly = true; | ||
async startWindowsPlayer(player: string, options: any = {}) { | ||
const command = "cmd /c spotify.exe"; | ||
let result = await musicUtil.execCmd(command); | ||
if (result === null || result === undefined || result === "") { | ||
result = "ok"; | ||
} | ||
return result; | ||
} | ||
async execScript( | ||
@@ -164,0 +176,0 @@ player: string, |
{ | ||
"name": "cody-music", | ||
"version": "2.6.90", | ||
"version": "2.6.91", | ||
"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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
520322
12703