This commit is contained in:
vapormusic 2022-08-01 23:33:11 +07:00 committed by GitHub
parent af78d7f5fe
commit f4c8edb10a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,10 +89,10 @@ export default class RAOP {
`; `;
private ondeviceup(name: any, host: any, port: any, addresses: any, text: any, airplay2: any = null) { private ondeviceup(name: any, host: any, port: any, addresses: any, text: any, airplay2: any = null) {
console.log(this.castDevices.findIndex((item: any) => {return (item.name == host.replace(".local","") && item.port == port )})) // console.log(this.castDevices.findIndex((item: any) => {return (item.name == host.replace(".local","") && item.port == port )}))
if (this.castDevices.findIndex((item: any) => {return (item.name == host.replace(".local","") && item.port == port )}) == -1) { if (this.castDevices.findIndex((item: any) => {return (item.name == host.replace(".local","") && item.port == port )}) == -1) {
this.castDevices.push({ this.castDevices.push({
name: host.replace(".local",""), name: (host ?? "Unknown").replace(".local",""),
host: addresses ? addresses[0] : '', host: addresses ? addresses[0] : '',
port: port, port: port,
addresses: addresses, addresses: addresses,