From 003297ecfd2e054c64173336ce4586464896589c Mon Sep 17 00:00:00 2001 From: Gab Date: Tue, 20 Oct 2020 11:45:48 -0400 Subject: [PATCH] Removed uncategorized from config --- qbittorrent_exporter/exporter.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/qbittorrent_exporter/exporter.py b/qbittorrent_exporter/exporter.py index 94d924c..2023ab7 100644 --- a/qbittorrent_exporter/exporter.py +++ b/qbittorrent_exporter/exporter.py @@ -25,7 +25,6 @@ class QbittorrentMetricsCollector(): "errored", "paused", ] - INCLUDE_UNCATEGORIZED = False def __init__(self, config): self.config = config @@ -36,7 +35,6 @@ class QbittorrentMetricsCollector(): username=config["username"], password=config["password"], ) - self.INCLUDE_UNCATEGORIZED = config["include_uncategorized"] == 'true' def collect(self): try: @@ -125,10 +123,9 @@ class QbittorrentMetricsCollector(): return [] metrics = [] - if self.INCLUDE_UNCATEGORIZED: - categories.Uncategorized = AttrDict({'name': 'Uncategorized', 'savePath': ''}) + categories.Uncategorized = AttrDict({'name': 'Uncategorized', 'savePath': ''}) for category in categories: - category_torrents = [t for t in self.torrents if t['category'] == category or (self.INCLUDE_UNCATEGORIZED and category == "Uncategorized" and t['category'] == "")] + category_torrents = [t for t in self.torrents if t['category'] == category or (category == "Uncategorized" and t['category'] == "")] for status in self.TORRENT_STATUSES: status_prop = f"is_{status}"