Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#

Trim white-space from categories returned by the sabnzbd get_config api.

nzbdav-dev8cb7409cf6b4
diff --git a/backend/Api/SabControllers/GetConfig/GetConfigController.cs b/backend/Api/SabControllers/GetConfig/GetConfigController.cs
index e4eb7cad..6b884208 100644
--- a/backend/Api/SabControllers/GetConfig/GetConfigController.cs
+++ b/backend/Api/SabControllers/GetConfig/GetConfigController.cs
@@ -30,6 +30,7 @@ public class GetConfigController(
// update the categories
var categoriesRoot = root["config"]?["categories"]?.AsArray()!;
var categories = configManager.GetApiCategories().Split(',')
+ .Select(x => x.Trim())
.Where(x => !string.IsNullOrWhiteSpace(x))
.ToList();
foreach (var category in categories)