From 9e9f4a9ce406dfdde21bffc8b3d753f8bceceac4 Mon Sep 17 00:00:00 2001 From: Gab Date: Tue, 20 Oct 2020 02:10:04 -0400 Subject: [PATCH] Added scraping for uncategorized torrents --- qbittorrent_exporter/exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qbittorrent_exporter/exporter.py b/qbittorrent_exporter/exporter.py index 75ed8e7..dbb495b 100644 --- a/qbittorrent_exporter/exporter.py +++ b/qbittorrent_exporter/exporter.py @@ -128,7 +128,7 @@ class QbittorrentMetricsCollector(): if self.INCLUDE_UNCATEGORIZED: categories.Uncategorized = AttrDict({'name': 'Uncategorized', 'savePath': ''}) for category in categories: - category_torrents = [t for t in self.torrents if t['category'] == category] +category_torrents = [t for t in self.torrents if t['category'] == category or (self.INCLUDE_UNCATEGORIZED and category == "Uncategorized" and t['category'] == "")] for status in self.TORRENT_STATUSES: status_prop = f"is_{status}" @@ -203,7 +203,7 @@ def main(): logger.info( f"Including uncategorized torrents: {config['include_uncategorized']}" ) - + # Start server start_http_server(config["exporter_port"]) logger.info(