diff --git a/emby_exporter/emby_exporter.py b/emby_exporter/emby_exporter.py index 28755ef..9f1af5b 100755 --- a/emby_exporter/emby_exporter.py +++ b/emby_exporter/emby_exporter.py @@ -30,7 +30,7 @@ from prometheus_client import Gauge, make_wsgi_app from wsgiref.simple_server import WSGIRequestHandler, WSGIServer, make_server -__VERSION__ = '0.1.2' +__VERSION__ = '0.1.3' class metric: @@ -48,11 +48,8 @@ def update_value(self, value): class metric_label: def __init__(self, name, value, label=None): self.name = name - if not label: - label = [*value.keys()][0] self.values = dict() self.label_values = list() - self.label_values.append(label) self.metric = Gauge('%s' % name.lower(), name.replace('_', ' '), [label]) self.update_value(value) @@ -245,16 +242,6 @@ def update_stats(self, data): self.metrics[i] = self.add_update_metric_label( 'emby_%s' % t.lower(), user_data[t], 'type') - for t in stats: - for i in stats[t]: - if i == 'user_data': - if 'played' in stats[t]['user_data']: - self.metrics['played'].labels(t).set( - stats[t]['user_data']['played']) - if 'isfavourite' in stats[t]['user_data']: - self.metrics['favourite'].labels(t).set( - stats[t]['user_data']['isfavourite']) - def update_metrics(self): self.emby.update_sync() diff --git a/setup.py b/setup.py index fe6bbca..7c8bcc5 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='emby_exporter', - version='0.1.2', + version='0.1.3', url='https://github.com/dr1s/emby_exporter.py', author='dr1s', license='MIT',