From 079008d5a4b739c210e7204b52c1fa25b11502a3 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 26 Apr 2022 22:25:44 +0700 Subject: [PATCH] add raop back --- package.json | 1 + {optional/Plugins => src/main/plugins}/raop.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) rename {optional/Plugins => src/main/plugins}/raop.ts (98%) diff --git a/package.json b/package.json index 330f2a35..70e22263 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@sentry/electron": "^3.0.7", "@sentry/integrations": "^6.19.6", "adm-zip": "0.4.10", + "airtunes2": "git+https://github.com/vapormusic/node_airtunes2.git", "castv2-client": "^1.2.0", "chokidar": "^3.5.3", "discord-rpc": "^4.0.1", diff --git a/optional/Plugins/raop.ts b/src/main/plugins/raop.ts similarity index 98% rename from optional/Plugins/raop.ts rename to src/main/plugins/raop.ts index c466b915..ce911834 100644 --- a/optional/Plugins/raop.ts +++ b/src/main/plugins/raop.ts @@ -20,10 +20,10 @@ export default class RAOP { private _app: any; private _store: any; private _cacheAttr: any; - + private u: any; private ipairplay: any = ""; private portairplay: any = ""; - private u = require('airtunes2'); + private airtunes: any; private device: any; private mdns = require('mdns-js'); @@ -132,6 +132,7 @@ export default class RAOP { * Runs on app ready */ onReady(win: any): void { + this.u = require('airtunes2'); this._win = win; electron.ipcMain.on('getKnownAirplayDevices', (event) => { @@ -146,7 +147,7 @@ export default class RAOP { browser.on('ready', browser.discover); browser.on('update', (service: any) => { - if (service.addresses && service.fullname && service.fullname.includes('_raop._tcp')) { + if (service.addresses && service.fullname && (service.fullname.includes('_raop._tcp') || service.fullname.includes('_airplay._tcp'))) { console.log(service.txt) this._win.webContents.executeJavaScript(`console.log( "${service.name} ${service.host}:${service.port} ${service.addresses}"