diff --git a/package.json b/package.json index 8edfbd66..31b73f0f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@sentry/electron": "^4.0.2", "@sentry/integrations": "^7.14.0", "adm-zip": "0.4.10", - "airtunes2": "github:ciderapp/node_airtunes2", + "airtunes2": "git+https://github.com/ciderapp/node_airtunes2.git", "castv2-client": "^1.2.0", "chokidar": "^3.5.3", "discord-auto-rpc": "^1.0.17", @@ -119,9 +119,9 @@ } ], "build": { - "electronVersion": "21.0.1", + "electronVersion": "20.3.0", "electronDownload": { - "version": "21.0.1+wvcus", + "version": "20.3.0+wvcus", "mirror": "https://github.com/castlabs/electron-releases/releases/download/v" }, "appId": "cider", diff --git a/src/main/plugins/raop.ts b/src/main/plugins/raop.ts index 9140ce8e..db4830ba 100644 --- a/src/main/plugins/raop.ts +++ b/src/main/plugins/raop.ts @@ -229,7 +229,7 @@ export default class RAOP { password: sepassword, txt: txt, airplay2: airplay2dv, - debug: null, + debug: true, forceAlac: false, }), }); @@ -442,22 +442,26 @@ export default class RAOP { */ onBeforeQuit(): void {} - // /** - // * Runs on song change - // * @param attributes Music Attributes - // */ - // onNowPlayingItemDidChange(attributes: any): void { - // if (this.airtunes && this.device) { - // let title = attributes.name ? attributes.name : ''; - // let artist = attributes.artistName ? attributes.artistName : ''; - // let album = attributes.albumName ? attributes.albumName : ''; - // let artworkURL = attributes?.artwork?.url?.replace('{w}', '1024').replace('{h}', '1024') ?? null; - // console.log(this.device.key, title, artist, album); - // this.airtunes.setTrackInfo(this.device.key, title, artist, album); - // if (artworkURL) - // this.uploadImageAirplay(artworkURL) - // } - // } + /** + * Runs on song change + * @param attributes Music Attributes + */ + onNowPlayingItemDidChange(attributes: any): void { + if (this.airtunes && this.devices.length > 0) { + let title = attributes?.name ?? ""; + let artist = attributes?.artistName ?? ""; + let album = attributes?.albumName ?? ""; + for (let i in this.devices) { + console.log(this.devices[i].controller.key, title, artist, album); + this.airtunes.setTrackInfo(this.devices[i].controller.key, title, artist, album); + } + let artworkURL = attributes?.artwork?.url ?? null; + + if (artworkURL != null) { + this.uploadImageAirplay(artworkURL.replace("{w}", "1024").replace("{h}", "1024")); + } + } + } /** * Runs on playback State Change