From daabbe33888370cfe01433986e2922d19d2c127c Mon Sep 17 00:00:00 2001 From: friendly Friend Date: Tue, 14 Mar 2023 22:12:50 -0700 Subject: [PATCH] pre-release --- qbittorrent_exporter/exporter.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qbittorrent_exporter/exporter.py b/qbittorrent_exporter/exporter.py index efac0c1..7910fdc 100644 --- a/qbittorrent_exporter/exporter.py +++ b/qbittorrent_exporter/exporter.py @@ -77,18 +77,18 @@ class QbittorrentMetricsCollector(): ) #Photos - usersDatas = response_user_stats.json()["usageByUser"] # TODO rename usersdatas in the future - for x in range(0,userCount): # TODO rename usersdatas in the future + userData = response_user_stats.json()["usageByUser"] + for x in range(0,userCount): metrics.append( { "name": f"{self.config['metrics_prefix']}_photos_by_user", - "value": usersDatas[x]['photos'], + "value": userData[x]['photos'], "labels": { - "firstName": usersDatas[x]["userFirstName"], + "firstName": userData[x]["userFirstName"], }, - "help": f"Number of photos by user {usersDatas[x]['userFirstName']} " + "help": f"Number of photos by user {userData[x]['userFirstName']} " } ) @@ -98,12 +98,12 @@ class QbittorrentMetricsCollector(): metrics.append( { "name": f"{self.config['metrics_prefix']}_videos_by_user", - "value": usersDatas[x]['videos'], + "value": userData[x]['videos'], "labels": { - "firstName": usersDatas[x]["userFirstName"], + "firstName": userData[x]["userFirstName"], }, - "help": f"Number of photos by user {usersDatas[x]['userFirstName']} " + "help": f"Number of photos by user {userData[x]['userFirstName']} " } ) @@ -112,12 +112,12 @@ class QbittorrentMetricsCollector(): metrics.append( { "name": f"{self.config['metrics_prefix']}_usage_by_user", - "value": (usersDatas[x]['usage']), + "value": (userData[x]['usage']), "labels": { - "firstName": usersDatas[x]["userFirstName"], + "firstName": userData[x]["userFirstName"], }, - "help": f"Number of photos by user {usersDatas[x]['userFirstName']} " + "help": f"Number of photos by user {userData[x]['userFirstName']} " } )