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

View file

@ -90,7 +90,7 @@ 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 != null && item.name == (host ?? "Unknown").replace(".local","") && item.port == port )}) == -1) {
this.castDevices.push({ this.castDevices.push({
name: (host ?? "Unknown").replace(".local",""), name: (host ?? "Unknown").replace(".local",""),
host: addresses ? addresses[0] : '', host: addresses ? addresses[0] : '',