Fix event stream image URLs

This commit is contained in:
Samuel Elliott 2023-04-05 09:44:21 +01:00
parent 30333dec8e
commit ed33fd2a32
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
2 changed files with 4 additions and 4 deletions

View File

@ -47,11 +47,11 @@ services:
labels:
traefik.enable: true
traefik.http.routers.nxapi-presence.entrypoints: websecure
traefik.http.routers.nxapi-presence.rule: Host(`${TRAEFIK_HOST:-nxapi.ta.fancy.org.uk}`) && (Path(`/api/presence`) || PathPrefix(`/api/presence/`))
traefik.http.routers.nxapi-presence.rule: Host(`${TRAEFIK_HOST:-nxapi.ta.fancy.org.uk}`) && (Path(`/api/presence`) || PathPrefix(`/api/presence/`) || PathPrefix(`/api/splatnet3/resources/`))
traefik.http.routers.nxapi-presence.tls: true
traefik.http.services.nxapi-presence.loadbalancer.server.port: 80
environment:
DEBUG: '*,-express:*'
DEBUG: '*,-express:*,-send'
ZNC_PROXY_URL: http://znc-proxy/api/znc
NXAPI_PRESENCE_SERVER_USER: ${NXAPI_PRESENCE_SERVER_USER:-}
NXAPI_PRESENCE_SERVER_SPLATNET3_PROXY_URL: http://presence-splatnet3-proxy/api/splatnet3-presence

View File

@ -1064,7 +1064,7 @@ class Server extends HttpServer {
[keyof typeof result, typeof result[keyof typeof result]][]
) {
if (typeof key !== 'string') continue;
stream.sendEvent(key, value);
stream.sendEvent(key, {...value, [ResourceUrlMapSymbol]: result[ResourceUrlMapSymbol]});
}
await new Promise(rs => setTimeout(rs, this.update_interval));
@ -1083,7 +1083,7 @@ class Server extends HttpServer {
) {
if (typeof key !== 'string') continue;
if (JSON.stringify(value) === JSON.stringify(last_result[key])) continue;
stream.sendEvent(key, value);
stream.sendEvent(key, {...value, [ResourceUrlMapSymbol]: result[ResourceUrlMapSymbol]});
}
last_result = result;