From 0130e4ae2245c34fb1aab35164a704a1b9e63c94 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 15 Jun 2023 13:35:16 +0300 Subject: [PATCH] Some instances may disable usage stat --- funkwhale_cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/funkwhale_cli.py b/funkwhale_cli.py index 0c551d5..61d4b69 100755 --- a/funkwhale_cli.py +++ b/funkwhale_cli.py @@ -129,8 +129,9 @@ Insert token from "Access token" here''') k, v = i.get('verbose_name'), i.get('value') about_instance_info.append(f'{k}: {v}') about_instance_info.append('|||||Some stats:') - for k, v in ins_nodeinfo['metadata']['usage'].items(): - about_instance_info.append(f'{k}: {v}') + if ins_nodeinfo['metadata'].get('usage'): + for k, v in ins_nodeinfo['metadata']['usage'].items(): + about_instance_info.append(f'{k}: {v}') for k, v in ins_nodeinfo['metadata']['library'].items(): about_instance_info.append(f'{k}: {v}') for k, v in ins_nodeinfo['usage'].items():