From a023bd619c5c3cbdf559ca37ddd59087a937c033 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Wed, 31 Aug 2022 17:43:57 +0700 Subject: [PATCH 01/13] add dlna and ui fixes --- package.json | 3 +- src/main/plugins/chromecast.ts | 62 +++++++++---------- src/main/plugins/raop.ts | 2 +- src/renderer/main/vueapp.js | 14 +++-- .../views/components/mediaitem-mvview-sp.ejs | 2 +- .../views/components/mediaitem-square.ejs | 9 ++- src/renderer/views/pages/apple-curator.ejs | 7 ++- src/renderer/views/pages/search.ejs | 4 +- .../views/components/mediaitem-artwork.ejs | 5 +- .../views/components/mediaitem-square.ejs | 2 +- 10 files changed, 64 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index bc85142f..ab00ee7a 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "run-script-os": "^1.1.6", "source-map-support": "^0.5.21", "ts-md5": "1.2.11", + "upnp-mediarenderer-client": "github:vapormusic/node-upnp-mediarenderer-client", "v8-compile-cache": "^2.3.0", "wallpaper": "5.0.1", "ws": "^8.8.1", @@ -78,9 +79,9 @@ "@types/adm-zip": "^0.5.0", "@types/discord-rpc": "4.0.3", "@types/express": "^4.17.13", + "@types/node": "^18.7.13", "@types/qrcode-terminal": "^0.12.0", "@types/ws": "^8.5.3", - "@types/node": "^18.7.13", "electron": "git+https://github.com/castlabs/electron-releases.git", "electron-builder": "^23.0.2", "electron-builder-notarize-pkg": "^1.2.0", diff --git a/src/main/plugins/chromecast.ts b/src/main/plugins/chromecast.ts index 4ef8c02c..fa709e06 100644 --- a/src/main/plugins/chromecast.ts +++ b/src/main/plugins/chromecast.ts @@ -2,6 +2,7 @@ import * as electron from "electron"; import * as os from "os"; import { resolve } from "path"; import * as CiderReceiver from "../base/castreceiver"; +const MediaRendererClient = require('upnp-mediarenderer-client') export default class ChromecastPlugin { /** @@ -14,6 +15,7 @@ export default class ChromecastPlugin { private _timer: any; private audioClient = require("castv2-client").Client; private mdns = require("mdns-js"); + private devices: any = []; private castDevices: any = []; @@ -67,19 +69,17 @@ export default class ChromecastPlugin { ssdpBrowser.search("urn:dial-multiscreen-org:device:dial:1"); - // // actual upnp devices - // if (app.cfg.get("audio.enableDLNA")) { - // let ssdpBrowser2 = new Client(); - // ssdpBrowser2.on('response', (headers, statusCode, rinfo) => { - // var location = getLocation(headers); - // if (location != null) { - // this.getServiceDescription(location, rinfo.address); - // } + // actual upnp devices + let ssdpBrowser2 = new Client(); + ssdpBrowser2.on('response', (headers: any, statusCode: any, rinfo: any) => { + var location = getLocation(headers); + if (location != null) { + this.getServiceDescription(location, rinfo.address); + } - // }); - // ssdpBrowser2.search('urn:schemas-upnp-org:device:MediaRenderer:1'); + }); + ssdpBrowser2.search('urn:schemas-upnp-org:device:MediaRenderer:1'); - // } } catch (e) { console.log("Search GC err", e); } @@ -257,26 +257,26 @@ export default class ChromecastPlugin { }); } else { // upnp devices - //try { - // client = new MediaRendererClient(UPNPDesc); - // const options = { - // autoplay: true, - // contentType: 'audio/x-wav', - // dlnaFeatures: 'DLNA.ORG_PN=-;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000', - // metadata: { - // title: 'Apple Music Electron', - // creator: 'Streaming ...', - // type: 'audio', // can be 'video', 'audio' or 'image' - // // url: 'http://' + getIp() + ':' + server.address().port + '/', - // // protocolInfo: 'DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000; - // } - // }; - // client.load('http://' + getIp() + ':' + server.address().port + '/a.wav', options, function (err, _result) { - // if (err) throw err; - // console.log('playing ...'); - // }); - // } catch (e) { - // } + try { + let client = new MediaRendererClient(UPNPDesc); + const options = { + autoplay: true, + contentType: 'audio/x-wav', + dlnaFeatures: 'DLNA.ORG_PN=-;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000', + metadata: { + title: 'Cider', + creator: 'Streaming ...', + type: 'audio', // can be 'video', 'audio' or 'image' + // url: 'http://' + getIp() + ':' + server.address().port + '/', + // protocolInfo: 'DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000; + } + }; + client.load('http://' + this.getIp() + ':' + this.ciderPort + '/audio.wav', options, function (err: any, _result: any) { + if (err) throw err; + console.log('playing ...'); + }); + } catch (e) { + } } } diff --git a/src/main/plugins/raop.ts b/src/main/plugins/raop.ts index d9ab814f..2bdb51d3 100644 --- a/src/main/plugins/raop.ts +++ b/src/main/plugins/raop.ts @@ -216,7 +216,7 @@ export default class RAOP { password: sepassword, txt: txt, airplay2: airplay2dv, - debug: true, + debug: null, }); // console.log('lol',txt) this.device.on("status", (status: any) => { diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index ca0b9509..175c1f5d 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -2007,9 +2007,10 @@ const app = new Vue({ include: "grouping,playlists", extend: "editorialArtwork", "art[url]": "f", - }); + }).then(() => { + kind = "appleCurator"; window.location.hash = `${kind}/${id}`; - document.querySelector("#app-content").scrollTop = 0; + document.querySelector("#app-content").scrollTop = 0}); } else if (kind == "editorial-elements" || kind == "editorial-items") { console.debug(item); if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) { @@ -4022,6 +4023,7 @@ const app = new Vue({ } }, getMediaItemArtwork(url, height = 64, width) { + try { if (typeof url == "undefined" || url == "") { return "./assets/MissingArtwork.svg"; } @@ -4029,7 +4031,7 @@ const app = new Vue({ if (width) { width = parseInt(width * window.devicePixelRatio); } - let newurl = `${url + let newurl = `${(url ?? "") .replace("{w}", width ?? height) .replace("{h}", height) .replace("{f}", "webp") @@ -4038,7 +4040,11 @@ const app = new Vue({ if (newurl.includes("900x516")) { newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr"); } - return newurl; + return newurl;} + catch (e) { + console.log(url) + return "./assets/MissingArtwork.svg" + } }, _rgbToRgb(rgb = [0, 0, 0]) { // if rgb diff --git a/src/renderer/views/components/mediaitem-mvview-sp.ejs b/src/renderer/views/components/mediaitem-mvview-sp.ejs index ea0bc5aa..5ec81176 100644 --- a/src/renderer/views/components/mediaitem-mvview-sp.ejs +++ b/src/renderer/views/components/mediaitem-mvview-sp.ejs @@ -15,7 +15,7 @@
diff --git a/src/renderer/views/components/mediaitem-square.ejs b/src/renderer/views/components/mediaitem-square.ejs index 838477f3..e10c873b 100644 --- a/src/renderer/views/components/mediaitem-square.ejs +++ b/src/renderer/views/components/mediaitem-square.ejs @@ -45,9 +45,9 @@
-
{{ item.attributes?.name.replace(/ /g, ' ').replace(/Apple Music |^Apple |/g, '') ?? +
{{ (item.attributes?.editorialElementKind == "394" && item.relationships?.contents?.data[0]?.attributes?.shortName != null ) ? item.relationships?.contents?.data[0]?.attributes?.shortName : (item.attributes?.name ? ((removeamtext ) ? item.attributes?.name.replace(/ /g, ' ').replace(/Apple Music |^Apple |/g, '') : item.attributes?.name.replace(/ /g, ' ')) : (item.relationships?.contents?.data[0]?.attributes?.name ?? - (item.attributes?.editorialNotes?.name ?? '')) }} + (item.attributes?.editorialNotes?.name ?? ''))) }}
@@ -98,6 +98,11 @@ Vue.component('mediaitem-square', { default: 'cc', required: false }, + removeamtext: { + type: Boolean, + default: false, + required: false + }, 'contextExt': { type: Object, required: false }, }, data: function () { diff --git a/src/renderer/views/pages/apple-curator.ejs b/src/renderer/views/pages/apple-curator.ejs index 0e11bea5..f6e9d055 100644 --- a/src/renderer/views/pages/apple-curator.ejs +++ b/src/renderer/views/pages/apple-curator.ejs @@ -1,6 +1,6 @@ diff --git a/src/renderer/views/pages/search.ejs b/src/renderer/views/pages/search.ejs index 0bdd63de..2f8d967a 100644 --- a/src/renderer/views/pages/search.ejs +++ b/src/renderer/views/pages/search.ejs @@ -142,10 +142,10 @@
- + v-for="item of getFlattenedCategories()"/>
diff --git a/src/web-remote/views/components/mediaitem-artwork.ejs b/src/web-remote/views/components/mediaitem-artwork.ejs index 9f651a45..e4760eb8 100644 --- a/src/web-remote/views/components/mediaitem-artwork.ejs +++ b/src/web-remote/views/components/mediaitem-artwork.ejs @@ -86,6 +86,7 @@ this.isVisible = isVisible }, getMediaItemArtwork(url, height = 64, width) { + try{ if (typeof url == "undefined" || url == "") { return "./assets/MissingArtwork.svg" } @@ -98,7 +99,9 @@ if (newurl.includes("900x516")) { newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr"); } - return newurl + return newurl} catch (e){ + return "./assets/MissingArtwork.svg" + } }, } }); diff --git a/src/web-remote/views/components/mediaitem-square.ejs b/src/web-remote/views/components/mediaitem-square.ejs index c3d6ab13..0d8d27da 100644 --- a/src/web-remote/views/components/mediaitem-square.ejs +++ b/src/web-remote/views/components/mediaitem-square.ejs @@ -213,7 +213,7 @@ } switch (this.kind) { case "385": - artwork = this.item.attributes.editorialArtwork.subscriptionHero.url + artwork = this.item.attributes?.editorialArtwork?.subscriptionHero?.url break; } if (!includeUrl) { From c32b9b6d7041d303917d63e344f79cdb589be769 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Thu, 1 Sep 2022 12:39:13 +0000 Subject: [PATCH 02/13] chore: Prettified Code [ci skip] --- src/main/plugins/chromecast.ts | 56 +++++++++++++++----------------- src/renderer/main/vueapp.js | 59 ++++++++++++++++++---------------- 2 files changed, 57 insertions(+), 58 deletions(-) diff --git a/src/main/plugins/chromecast.ts b/src/main/plugins/chromecast.ts index fa709e06..d140cd84 100644 --- a/src/main/plugins/chromecast.ts +++ b/src/main/plugins/chromecast.ts @@ -2,7 +2,7 @@ import * as electron from "electron"; import * as os from "os"; import { resolve } from "path"; import * as CiderReceiver from "../base/castreceiver"; -const MediaRendererClient = require('upnp-mediarenderer-client') +const MediaRendererClient = require("upnp-mediarenderer-client"); export default class ChromecastPlugin { /** @@ -15,7 +15,6 @@ export default class ChromecastPlugin { private _timer: any; private audioClient = require("castv2-client").Client; private mdns = require("mdns-js"); - private devices: any = []; private castDevices: any = []; @@ -71,15 +70,13 @@ export default class ChromecastPlugin { // actual upnp devices let ssdpBrowser2 = new Client(); - ssdpBrowser2.on('response', (headers: any, statusCode: any, rinfo: any) => { - var location = getLocation(headers); - if (location != null) { - this.getServiceDescription(location, rinfo.address); - } - - }); - ssdpBrowser2.search('urn:schemas-upnp-org:device:MediaRenderer:1'); - + ssdpBrowser2.on("response", (headers: any, statusCode: any, rinfo: any) => { + var location = getLocation(headers); + if (location != null) { + this.getServiceDescription(location, rinfo.address); + } + }); + ssdpBrowser2.search("urn:schemas-upnp-org:device:MediaRenderer:1"); } catch (e) { console.log("Search GC err", e); } @@ -258,25 +255,24 @@ export default class ChromecastPlugin { } else { // upnp devices try { - let client = new MediaRendererClient(UPNPDesc); - const options = { - autoplay: true, - contentType: 'audio/x-wav', - dlnaFeatures: 'DLNA.ORG_PN=-;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000', - metadata: { - title: 'Cider', - creator: 'Streaming ...', - type: 'audio', // can be 'video', 'audio' or 'image' - // url: 'http://' + getIp() + ':' + server.address().port + '/', - // protocolInfo: 'DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000; - } - }; - client.load('http://' + this.getIp() + ':' + this.ciderPort + '/audio.wav', options, function (err: any, _result: any) { - if (err) throw err; - console.log('playing ...'); - }); - } catch (e) { - } + let client = new MediaRendererClient(UPNPDesc); + const options = { + autoplay: true, + contentType: "audio/x-wav", + dlnaFeatures: "DLNA.ORG_PN=-;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000", + metadata: { + title: "Cider", + creator: "Streaming ...", + type: "audio", // can be 'video', 'audio' or 'image' + // url: 'http://' + getIp() + ':' + server.address().port + '/', + // protocolInfo: 'DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000; + }, + }; + client.load("http://" + this.getIp() + ":" + this.ciderPort + "/audio.wav", options, function (err: any, _result: any) { + if (err) throw err; + console.log("playing ..."); + }); + } catch (e) {} } } diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 175c1f5d..d9aaed7c 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -2002,15 +2002,18 @@ const app = new Vue({ } if (kind.toString().includes("apple-curator")) { kind = "appleCurator"; - app.getTypeFromID("appleCurator", id, false, { - platform: "web", - include: "grouping,playlists", - extend: "editorialArtwork", - "art[url]": "f", - }).then(() => { - kind = "appleCurator"; - window.location.hash = `${kind}/${id}`; - document.querySelector("#app-content").scrollTop = 0}); + app + .getTypeFromID("appleCurator", id, false, { + platform: "web", + include: "grouping,playlists", + extend: "editorialArtwork", + "art[url]": "f", + }) + .then(() => { + kind = "appleCurator"; + window.location.hash = `${kind}/${id}`; + document.querySelector("#app-content").scrollTop = 0; + }); } else if (kind == "editorial-elements" || kind == "editorial-items") { console.debug(item); if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) { @@ -4024,26 +4027,26 @@ const app = new Vue({ }, getMediaItemArtwork(url, height = 64, width) { try { - if (typeof url == "undefined" || url == "") { - return "./assets/MissingArtwork.svg"; - } - height = parseInt(height * window.devicePixelRatio); - if (width) { - width = parseInt(width * window.devicePixelRatio); - } - let newurl = `${(url ?? "") - .replace("{w}", width ?? height) - .replace("{h}", height) - .replace("{f}", "webp") - .replace("{c}", width === 900 || width === 380 || width === 600 ? "sr" : "cc")}`; + if (typeof url == "undefined" || url == "") { + return "./assets/MissingArtwork.svg"; + } + height = parseInt(height * window.devicePixelRatio); + if (width) { + width = parseInt(width * window.devicePixelRatio); + } + let newurl = `${(url ?? "") + .replace("{w}", width ?? height) + .replace("{h}", height) + .replace("{f}", "webp") + .replace("{c}", width === 900 || width === 380 || width === 600 ? "sr" : "cc")}`; - if (newurl.includes("900x516")) { - newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr"); - } - return newurl;} - catch (e) { - console.log(url) - return "./assets/MissingArtwork.svg" + if (newurl.includes("900x516")) { + newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr"); + } + return newurl; + } catch (e) { + console.log(url); + return "./assets/MissingArtwork.svg"; } }, _rgbToRgb(rgb = [0, 0, 0]) { From 26b231ee70e0b3188944d1923e515aedbdcb9f52 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Wed, 31 Aug 2022 17:49:47 +0700 Subject: [PATCH 03/13] fix closing dlna --- src/main/plugins/chromecast.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/plugins/chromecast.ts b/src/main/plugins/chromecast.ts index d140cd84..07a1a18d 100644 --- a/src/main/plugins/chromecast.ts +++ b/src/main/plugins/chromecast.ts @@ -272,6 +272,10 @@ export default class ChromecastPlugin { if (err) throw err; console.log("playing ..."); }); + if (!this.connectedHosts[device.host]) { + this.connectedHosts[device.host] = client; + this.activeConnections.push(client); + } } catch (e) {} } } From af27a3cd726685bd603ed3cd1e70f6fe6a48a15e Mon Sep 17 00:00:00 2001 From: vapormusic Date: Thu, 1 Sep 2022 12:45:32 +0000 Subject: [PATCH 04/13] chore: Updated Lockfile --- pnpm-lock.yaml | 76 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7967d21..bb1dcfb6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,6 +43,7 @@ specifiers: source-map-support: ^0.5.21 ts-md5: 1.2.11 typescript: ^4.7.4 + upnp-mediarenderer-client: github:vapormusic/node-upnp-mediarenderer-client v8-compile-cache: ^2.3.0 vue-devtools: ^5.1.4 wallpaper: 5.0.1 @@ -55,7 +56,7 @@ dependencies: '@sentry/electron': 4.0.0 '@sentry/integrations': 7.11.1 adm-zip: 0.4.10 - airtunes2: github.com/ciderapp/node_airtunes2/63e3a34a551aa700f89b622d65d19f52f48548ce + airtunes2: github.com/ciderapp/node_airtunes2/909bc9ae208731bfe286cc6ee46d075aa56766eb castv2-client: 1.2.0 chokidar: 3.5.3 discord-auto-rpc: 1.0.17 @@ -81,6 +82,7 @@ dependencies: run-script-os: 1.1.6 source-map-support: 0.5.21 ts-md5: 1.2.11 + upnp-mediarenderer-client: github.com/vapormusic/node-upnp-mediarenderer-client/d4856931500026eb6c4c67b3eb12c1c34755627e v8-compile-cache: 2.3.0 wallpaper: 5.0.1 ws: 8.8.1 @@ -94,7 +96,7 @@ devDependencies: '@types/node': 18.7.13 '@types/qrcode-terminal': 0.12.0 '@types/ws': 8.5.3 - electron: github.com/castlabs/electron-releases/a1749958b51da6ce1596992260cbacb602c23762 + electron: github.com/castlabs/electron-releases/8ca09f8539dc0c3f5a57af3fe23fb2db9661ab68 electron-builder: 23.3.3 electron-builder-notarize-pkg: 1.2.0 electron-webpack: 2.8.2_webpack@5.74.0 @@ -3459,6 +3461,16 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + /concat-stream/1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.7 + typedarray: 0.0.6 + dev: false + /conf/10.2.0: resolution: {integrity: sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==} engines: {node: '>=12'} @@ -4285,6 +4297,13 @@ packages: mkdirp: 0.5.6 dev: false + /elementtree/0.1.7: + resolution: {integrity: sha512-wkgGT6kugeQk/P6VZ/f4T+4HB41BVgNBq5CDIZVbQ02nvTVqAiVTbskxxu3eA/X96lMlfYOwnLQpN2v5E1zDEg==} + engines: {node: '>= 0.4.0'} + dependencies: + sax: 1.1.4 + dev: false + /elliptic/6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} dependencies: @@ -6064,7 +6083,6 @@ packages: /isarray/1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: true /isbinaryfile/3.0.3: resolution: {integrity: sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==} @@ -6891,6 +6909,11 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true + /network-address/1.1.2: + resolution: {integrity: sha512-Q6878fmvItA1mE7H9Il46lONgFgTzX2f98zkS0c2YlkCACzNjwvum/8Kq693IQpxe9zy+w+Zm/4p0wQreLEtZw==} + hasBin: true + dev: false + /nice-try/1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} dev: true @@ -7570,7 +7593,6 @@ packages: /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - dev: true /process/0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} @@ -7808,7 +7830,6 @@ packages: safe-buffer: 5.1.2 string_decoder: 1.1.1 util-deprecate: 1.0.2 - dev: true /readable-stream/3.6.0: resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} @@ -8097,7 +8118,6 @@ packages: /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true /safe-buffer/5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -8117,6 +8137,10 @@ packages: truncate-utf8-bytes: 1.0.2 dev: true + /sax/1.1.4: + resolution: {integrity: sha512-5f3k2PbGGp+YtKJjOItpg3P99IMD84E4HOvcfleTb5joCHNXYLsR9yWFPOYGgaeMPDubQILTCMdsFb2OMeOjtg==} + dev: false + /sax/1.2.4: resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} @@ -8694,7 +8718,6 @@ packages: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: safe-buffer: 5.1.2 - dev: true /string_decoder/1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -9081,6 +9104,10 @@ packages: is-typedarray: 1.0.0 dev: true + /typedarray/0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: false + /typescript/4.7.4: resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==} engines: {node: '>=4.2.0'} @@ -9838,10 +9865,10 @@ packages: got: 11.8.5 dev: false - github.com/castlabs/electron-releases/a1749958b51da6ce1596992260cbacb602c23762: - resolution: {tarball: https://codeload.github.com/castlabs/electron-releases/tar.gz/a1749958b51da6ce1596992260cbacb602c23762} + github.com/castlabs/electron-releases/8ca09f8539dc0c3f5a57af3fe23fb2db9661ab68: + resolution: {tarball: https://codeload.github.com/castlabs/electron-releases/tar.gz/8ca09f8539dc0c3f5a57af3fe23fb2db9661ab68} name: electron - version: 21.0.0-alpha.5 + version: 21.0.0-beta.1 engines: {node: '>= 10.17.0'} hasBin: true requiresBuild: true @@ -9878,8 +9905,8 @@ packages: - supports-color dev: false - github.com/ciderapp/node_airtunes2/63e3a34a551aa700f89b622d65d19f52f48548ce: - resolution: {tarball: https://codeload.github.com/ciderapp/node_airtunes2/tar.gz/63e3a34a551aa700f89b622d65d19f52f48548ce} + github.com/ciderapp/node_airtunes2/909bc9ae208731bfe286cc6ee46d075aa56766eb: + resolution: {tarball: https://codeload.github.com/ciderapp/node_airtunes2/tar.gz/909bc9ae208731bfe286cc6ee46d075aa56766eb} name: airtunes2 version: 2.3.2 hasBin: true @@ -9936,6 +9963,31 @@ packages: readable-stream: 1.1.14 dev: false + github.com/vapormusic/node-upnp-device-client/371819a856573e3624768bd0a113ac6dc084053d: + resolution: {tarball: https://codeload.github.com/vapormusic/node-upnp-device-client/tar.gz/371819a856573e3624768bd0a113ac6dc084053d} + name: upnp-device-client + version: 1.0.2 + dependencies: + concat-stream: 1.6.2 + debug: 2.6.9 + elementtree: 0.1.7 + network-address: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + github.com/vapormusic/node-upnp-mediarenderer-client/d4856931500026eb6c4c67b3eb12c1c34755627e: + resolution: {tarball: https://codeload.github.com/vapormusic/node-upnp-mediarenderer-client/tar.gz/d4856931500026eb6c4c67b3eb12c1c34755627e} + name: upnp-mediarenderer-client + version: 1.4.0 + dependencies: + debug: 2.6.9 + elementtree: 0.1.7 + upnp-device-client: github.com/vapormusic/node-upnp-device-client/371819a856573e3624768bd0a113ac6dc084053d + transitivePeerDependencies: + - supports-color + dev: false + github.com/wavesplatform/curve25519-js/cae68782564b83ffa1c7c757e40a3944cb140290: resolution: {tarball: https://codeload.github.com/wavesplatform/curve25519-js/tar.gz/cae68782564b83ffa1c7c757e40a3944cb140290} name: axlsign From 8c9070c8da04eee99a43c8a9d55a6dd9a65a1ca8 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Wed, 31 Aug 2022 17:44:39 +0700 Subject: [PATCH 05/13] 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) { From 3b947a8361e2f0f267bdb29b185eb79cc63e850c Mon Sep 17 00:00:00 2001 From: vapormusic Date: Thu, 1 Sep 2022 14:39:54 +0000 Subject: [PATCH 06/13] chore: Prettified Code [ci skip] --- src/main/plugins/chromecast.ts | 7 ++++--- src/main/plugins/raop.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/plugins/chromecast.ts b/src/main/plugins/chromecast.ts index 009d73b8..46110e4e 100644 --- a/src/main/plugins/chromecast.ts +++ b/src/main/plugins/chromecast.ts @@ -319,9 +319,10 @@ export default class ChromecastPlugin { }); electron.ipcMain.on("getChromeCastDevices", (_event, _data) => { - if(this.scanCount++ == 2) { - this.scanCount = 0 - this.castDevices = [];} + 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 7da7fbad..d62909c7 100644 --- a/src/main/plugins/raop.ts +++ b/src/main/plugins/raop.ts @@ -217,7 +217,7 @@ export default class RAOP { txt: txt, airplay2: airplay2dv, debug: null, - forceAlac: false + forceAlac: false, }); // console.log('lol',txt) this.device.on("status", (status: any) => { From 8fb097e69a271435376546723650c543c3666f4a Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:21:14 +0800 Subject: [PATCH 07/13] Add GET for syncing with bot --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1aa3c3e2..79c618e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,9 +143,11 @@ jobs: if [[ "${APP_VERSION}" = *"beta"* ]]; then echo $'**Beta Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese builds are considered bleeding edge, expect bugs and please do not use this as a representation of the fu ll app.\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-nightly-beta-releases).' > release-notes.md gh release create "v${APP_VERSION}" --prerelease --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap + curl http://129.146.42.180/api/v1/github/sync/main else echo $'**Stable Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese are the most stable builds we can provide. If you experience any issues, please report them [here](https://github.com/ciderapp/cider/issues/new).\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-releases).' > release-notes.md gh release create "v${APP_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap + curl http://129.146.42.180/api/v1/github/sync/stable fi; # Orchestrate our job run sequence From 9d9158b409fbad8ce337f72f98e165371c512330 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:29:20 +0800 Subject: [PATCH 08/13] Update build-macos.yml --- .github/workflows/build-macos.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 84d25b91..03cba7ad 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -125,3 +125,7 @@ jobs: repo_token: ${{ secrets.RELEASE_TOKEN }} file: dist/Cider-${{ env.APP_VERSION }}-universal.pkg tag: v${{ env.APP_VERSION }} + - name: Trigger Bot Sync + uses: indiesdev/curl@v1.1 + with: + url: http://129.146.42.180/api/v1/github/sync/${{ GITHUB_REF##*/ }} From 4228656f2420cc791183260c29da0b6b25a003a3 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:30:48 +0800 Subject: [PATCH 09/13] Update build-macos.yml --- .github/workflows/build-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 03cba7ad..41398db7 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -128,4 +128,4 @@ jobs: - name: Trigger Bot Sync uses: indiesdev/curl@v1.1 with: - url: http://129.146.42.180/api/v1/github/sync/${{ GITHUB_REF##*/ }} + url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} From 60ae73ce89055393e4b4fc7ae3fa32efb7dd97f5 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 12:14:44 +0800 Subject: [PATCH 10/13] Update build-macos.yml --- .github/workflows/build-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 41398db7..9117e9d0 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -129,3 +129,4 @@ jobs: uses: indiesdev/curl@v1.1 with: url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} + log-response: true From 70ec3a19a6a793521bdf7b5ebacdf5bd82315f53 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 12:43:07 +0800 Subject: [PATCH 11/13] Update build-macos.yml --- .github/workflows/build-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 9117e9d0..c5d1bfe3 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -130,3 +130,4 @@ jobs: with: url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} log-response: true + timeout: 60000 From 54400c1e8b755ed120c99a285165b3cd87c2163f Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 13:14:43 +0800 Subject: [PATCH 12/13] Update build-macos.yml --- .github/workflows/build-macos.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index c5d1bfe3..85f58991 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -125,9 +125,16 @@ jobs: repo_token: ${{ secrets.RELEASE_TOKEN }} file: dist/Cider-${{ env.APP_VERSION }}-universal.pkg tag: v${{ env.APP_VERSION }} - - name: Trigger Bot Sync + - name: Trigger Bot Sync (main) uses: indiesdev/curl@v1.1 with: - url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} + url: http://129.146.42.180/api/v1/github/sync/main log-response: true timeout: 60000 + - name: Trigger Bot Sync (stable) + uses: indiesdev/curl@v1.1 + with: + url: http://129.146.42.180/api/v1/github/sync/stable + log-response: true + timeout: 60000 + From 15ef1352e9d3fe55e000db10336b3fd944c57452 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:40:22 +0800 Subject: [PATCH 13/13] Update github cli to use orb --- .circleci/config.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79c618e3..27466672 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ executors: orbs: # Add orbs to your configuration jira: circleci/jira@1.0.5 # invokes the Jira orb, making its commands accessible - + gh: circleci/github-cli@2.1 # The jobs for this project jobs: prepare-build: @@ -111,14 +111,7 @@ jobs: steps: - attach_workspace: at: ~/Cider/ - - run: - name: Installing GitHub Command Line Interface - command: | - sudo apt-get update -y - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - sudo apt-get update -y - sudo apt install -y gh + - gh/install - run: name: Move Build Files command: |