From 7df55305ca0ba1b89c9ba7ce76a28d95dd02c572 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 27 Nov 2018 13:24:38 +0000 Subject: Make channel stats in /api/servers a dictionary --- modules/stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/stats.py b/modules/stats.py index 279e6593..a5e8bea9 100644 --- a/modules/stats.py +++ b/modules/stats.py @@ -59,7 +59,8 @@ class Module(ModuleManager.BaseModule): "users": len(server.users), "bytes-written": server.bytes_written, "bytes-read": server.bytes_read, - "channels": [self._channel_stats(c) for c in server.channels] + "channels": { + c.name: self._channel_stats(c) for c in server.channels} } @utils.hook("api.get.servers") -- cgit v1.3.1-10-gc9f91