From 8c9070c8da04eee99a43c8a9d55a6dd9a65a1ca8 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Wed, 31 Aug 2022 17:44:39 +0700 Subject: [PATCH] casting fix --- src/main/plugins/chromecast.ts | 4 ++++ src/main/plugins/raop.ts | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/plugins/chromecast.ts b/src/main/plugins/chromecast.ts index 07a1a18d..009d73b8 100644 --- a/src/main/plugins/chromecast.ts +++ b/src/main/plugins/chromecast.ts @@ -29,6 +29,7 @@ export default class ChromecastPlugin { private connectedHosts: any = {}; private connectedPlayer: any; private ciderPort: any = 9000; + private scanCount: any = 0; // private server = false; // private bufcount = 0; // private bufcount2 = 0; @@ -318,6 +319,9 @@ export default class ChromecastPlugin { }); electron.ipcMain.on("getChromeCastDevices", (_event, _data) => { + if(this.scanCount++ == 2) { + this.scanCount = 0 + this.castDevices = [];} this.searchForGCDevices(); }); diff --git a/src/main/plugins/raop.ts b/src/main/plugins/raop.ts index 2bdb51d3..7da7fbad 100644 --- a/src/main/plugins/raop.ts +++ b/src/main/plugins/raop.ts @@ -217,6 +217,7 @@ export default class RAOP { txt: txt, airplay2: airplay2dv, debug: null, + forceAlac: false }); // console.log('lol',txt) this.device.on("status", (status: any) => { @@ -235,15 +236,15 @@ export default class RAOP { this._win.webContents.executeJavaScript(`app.sendAirPlayFailed()`); } if (status == "stopped") { - this.airtunes.stopAll(() => { - console.log("end"); - }); - this._win.webContents.executeJavaScript(`app.airplayDisconnect(true, ${[ipv4, ipport, sepassword, title, artist, album, artworkURL, txt, airplay2dv]})`).catch((err: any) => console.error(err)); - this.airtunes = null; - this.device = null; - this.ipairplay = ""; - this.portairplay = ""; - this.ok = 1; + // this.airtunes.stopAll(() => { + // console.log("end"); + // }); + // this._win.webContents.executeJavaScript(`app.airplayDisconnect(true, ${[ipv4, ipport, sepassword, title, artist, album, artworkURL, txt, airplay2dv]})`).catch((err: any) => console.error(err)); + // this.airtunes = null; + // this.device = null; + // this.ipairplay = ""; + // this.portairplay = ""; + // this.ok = 1; } else { setTimeout(() => { if (this.ok == 1) {