Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mediaportal pvr addon: don't return radio channels/channelgroup/chann…

…elgroup mappings when radio support is disabled.

+ debug cosmetics
  • Loading branch information...
commit 83984d1f934e3bd273249cf958316a4ebaec5f31 1 parent c8b1623
@margro authored
Showing with 41 additions and 10 deletions.
  1. +41 −10 xbmc/pvrclients/MediaPortal/pvrclient-mediaportal.cpp
View
51 xbmc/pvrclients/MediaPortal/pvrclient-mediaportal.cpp
@@ -579,20 +579,35 @@ PVR_ERROR cPVRClientMediaPortal::GetChannels(PVR_HANDLE handle, bool bRadio)
if(bRadio)
{
- XBMC->Log(LOG_DEBUG, "RequestChannelList for Radio group:%s", g_szRadioGroup.c_str());
-
if(!g_bRadioEnabled)
{
XBMC->Log(LOG_INFO, "Fetching radio channels is disabled.");
return PVR_ERROR_NO_ERROR;
}
- command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szRadioGroup).c_str());
+ if (g_szRadioGroup.length() > 0)
+ {
+ XBMC->Log(LOG_DEBUG, "GetChannels(radio) for radio group:%s", g_szRadioGroup.c_str());
+ command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szRadioGroup).c_str());
+ }
+ else
+ {
+ XBMC->Log(LOG_DEBUG, "GetChannels(radio) all channels");
+ command = "ListRadioChannels\n";
+ }
}
else
{
- XBMC->Log(LOG_DEBUG, "RequestChannelList for TV group:%s", g_szTVGroup.c_str());
- command.Format("ListTVChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szTVGroup).c_str());
+ if (g_szTVGroup.length() > 0)
+ {
+ XBMC->Log(LOG_DEBUG, "GetChannels(tv) for TV group:%s", g_szTVGroup.c_str());
+ command.Format("ListTVChannels:%s\n", uri::encode(uri::PATH_TRAITS, g_szTVGroup).c_str());
+ }
+ else
+ {
+ XBMC->Log(LOG_DEBUG, "GetChannels(tv) all channels");
+ command = "ListTVChannels\n";
+ }
}
if( !SendCommand2(command.c_str(), code, lines) )
@@ -692,9 +707,17 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroups(PVR_HANDLE handle, bool bRadio
if(bRadio)
{
- XBMC->Log(LOG_DEBUG, "GetChannelGroups for radio");
- if (!SendCommand2("ListRadioGroups\n", code, lines))
- return PVR_ERROR_SERVER_ERROR;
+ if (g_bRadioEnabled)
+ {
+ XBMC->Log(LOG_DEBUG, "GetChannelGroups for radio");
+ if (!SendCommand2("ListRadioGroups\n", code, lines))
+ return PVR_ERROR_SERVER_ERROR;
+ }
+ else
+ {
+ XBMC->Log(LOG_DEBUG, "Skipping GetChannelGroups for radio. Radio support is disabled.");
+ return PVR_ERROR_NO_ERROR;
+ }
}
else
{
@@ -742,8 +765,16 @@ PVR_ERROR cPVRClientMediaPortal::GetChannelGroupMembers(PVR_HANDLE handle, const
if(group.bIsRadio)
{
- XBMC->Log(LOG_DEBUG, "%s: for group '%s', radio=%i", __FUNCTION__, group.strGroupName, group.bIsRadio);
- command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, group.strGroupName).c_str());
+ if (g_bRadioEnabled)
+ {
+ XBMC->Log(LOG_DEBUG, "%s: for group '%s', radio=%i", __FUNCTION__, group.strGroupName, group.bIsRadio);
+ command.Format("ListRadioChannels:%s\n", uri::encode(uri::PATH_TRAITS, group.strGroupName).c_str());
+ }
+ else
+ {
+ XBMC->Log(LOG_DEBUG, "Skipping GetChannelGroupMembers for radio. Radio support is disabled.");
+ return PVR_ERROR_NO_ERROR;
+ }
}
else
{

0 comments on commit 83984d1

Please sign in to comment.
Something went wrong with that request. Please try again.