From 230068f35d3b243c131853992f91e27313e6f7b3 Mon Sep 17 00:00:00 2001
From: Lyndon Brown <jnqnfe@gmail.com>
Date: Thu, 6 Jun 2019 02:36:00 +0100
Subject: [PATCH] upnp: fix bad option default

the lowercase "auto" default option value did not match the uppercase
"Auto" in the choice list.

option values should typically be lowercase. this fixes the mistake with
the case of the choice value, whilst maintaining backwards compatibility
with existing CLI usage and from saved settings files. this was the
clear preference for fixing this resulting from the MR discussion.
---
 modules/services_discovery/upnp.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 359ee094a7bc..a6993e18542d 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -72,7 +72,7 @@ const char* SATIP_SERVER_DEVICE_TYPE = "urn:ses-com:device:SatIPServer:1";
 #define URL_LONGTEXT N_("The Url used to get the xml descriptor of the UPnP Renderer")
 
 static const char *const ppsz_satip_channel_lists[] = {
-    "Auto", "ASTRA_19_2E", "ASTRA_28_2E", "ASTRA_23_5E", "MasterList", "ServerList", "CustomList"
+    "auto", "ASTRA_19_2E", "ASTRA_28_2E", "ASTRA_23_5E", "MasterList", "ServerList", "CustomList"
 };
 static const char *const ppsz_readible_satip_channel_lists[] = {
     N_("Auto"), "Astra 19.2°E", "Astra 28.2°E", "Astra 23.5°E", N_("SAT>IP Main List"), N_("Device List"), N_("Custom List")
@@ -651,7 +651,8 @@ MediaServerList::parseSatipServer( IXML_Element* p_device_element, const char *p
     /* In Auto mode, default to MasterList list from satip.info */
     bool automode = false;
     if( !psz_satip_channellist || /* On lookup failure or empty string, use auto mode */
-        strcmp(psz_satip_channellist, "Auto") == 0 )
+        strcmp(psz_satip_channellist, "auto") == 0 ||
+        strcmp(psz_satip_channellist, "Auto") == 0 ) /* for backwards compatibility */
     {
         automode = true;
         if( psz_satip_channellist )
-- 
GitLab