Skip to content

Commit

Permalink
fix: quitITunes function
Browse files Browse the repository at this point in the history
  • Loading branch information
N0chteil committed Mar 9, 2023
1 parent 11fc5bc commit f7b44b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/win32/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AppleBridge } from "../index";
import { execSync } from "child_process";
import { checkIfMusicRunning } from "../utils/checkIfMusicRunning";

import * as path from "path";

Expand Down Expand Up @@ -57,6 +58,14 @@ export function quitITunes() {
try {
console.log("[Win32][quitITunes]", "Killing iTunes");
execSync(`taskkill /F /IM "iTunes.exe"`);

const checkIfRunningInt = setInterval(() => {
if (checkIfMusicRunning()) {
clearInterval(checkIfRunningInt);

fetchAllInterval = setInterval(fetchAll, 1000);
}
}, 5000);
} catch (e) {
console.error("[Win32][quitITunes]", "Error killing iTunes:", e);
}
Expand Down

0 comments on commit f7b44b5

Please sign in to comment.