diff --git a/pvr.nextpvr/addon.xml.in b/pvr.nextpvr/addon.xml.in index 080bb768..4472579b 100644 --- a/pvr.nextpvr/addon.xml.in +++ b/pvr.nextpvr/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.nextpvr/changelog.txt b/pvr.nextpvr/changelog.txt index 242b61b9..bc65bbca 100644 --- a/pvr.nextpvr/changelog.txt +++ b/pvr.nextpvr/changelog.txt @@ -1,3 +1,7 @@ +v20.4.3 + - Add missing return ChannelGroup return code + - Stop caching LiveStreams.xml + v20.4.2 - Return error if channel calls are made when not connected - Fast poll for servers after returning from sleep diff --git a/src/BackendRequest.cpp b/src/BackendRequest.cpp index 3c2c3b84..ee4e085c 100644 --- a/src/BackendRequest.cpp +++ b/src/BackendRequest.cpp @@ -21,9 +21,11 @@ namespace NextPVR int Request::DoRequest(std::string resource, std::string& response) { auto start = std::chrono::steady_clock::now(); + char separator = resource.find("?") == std::string::npos ? '?' : '&'; std::unique_lock lock(m_mutexRequest); - // build request string, adding SID if requred - const std::string URL = kodi::tools::StringUtils::Format("%s%s&sid=%s", m_settings->m_urlBase, resource.c_str(), GetSID()); + // build request string, adding SID + const std::string URL = kodi::tools::StringUtils::Format("%s%s%csid=%s", m_settings->m_urlBase, + resource.c_str(), separator, GetSID()); // ask XBMC to read the URL for us int resultCode = HTTP_NOTFOUND; @@ -38,7 +40,7 @@ namespace NextPVR } stream.Close(); resultCode = HTTP_OK; - if ((response.empty() || strstr(response.c_str(), "") == nullptr) && resource.find("channel.stream.info") == std::string::npos) + if (response.empty()) { kodi::Log(ADDON_LOG_ERROR, "DoRequest failed, response=%s", response.c_str()); resultCode = HTTP_BADREQUEST; diff --git a/src/Channels.cpp b/src/Channels.cpp index 754f8a82..94c5d58c 100644 --- a/src/Channels.cpp +++ b/src/Channels.cpp @@ -314,6 +314,7 @@ PVR_ERROR Channels::GetChannelGroupMembers(const kodi::addon::PVRChannelGroup& g results.Add(tag); } } + returnValue = PVR_ERROR_NO_ERROR; } else { @@ -350,14 +351,13 @@ bool Channels::IsChannelAPlugin(int uid) /************************************************************/ void Channels::LoadLiveStreams() { + std::string response; const std::string URL = "/public/LiveStreams.xml"; m_liveStreams.clear(); - if (m_request.FileCopy(URL.c_str(), m_settings->m_instanceDirectory + "LiveStreams.xml") == HTTP_OK) + if (m_request.DoRequest(URL, response) == HTTP_OK) { tinyxml2::XMLDocument doc; - std::string liveStreams = kodi::vfs::TranslateSpecialProtocol(m_settings->m_instanceDirectory + "LiveStreams.xml"); - kodi::Log(ADDON_LOG_DEBUG, "Loading LiveStreams.xml %s", liveStreams.c_str()); - if (doc.LoadFile(liveStreams.c_str()) == tinyxml2::XML_SUCCESS) + if (doc.Parse(response.c_str()) == tinyxml2::XML_SUCCESS) { tinyxml2::XMLNode* streamsNode = doc.FirstChildElement("streams"); if (streamsNode) @@ -382,5 +382,9 @@ void Channels::LoadLiveStreams() } } } + else + { + kodi::Log(ADDON_LOG_ERROR, "LiveStreams invalid xml"); + } } }