From e30167549bbd7a33b2aca4bdc93ddf9e2b83c442 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Tue, 6 Oct 2020 18:50:19 +0100 Subject: [PATCH] Use kodi StringUtils and remove p8-platform dependency - v6.0.1 --- CMakeLists.txt | 3 --- depends/common/p8-platform/p8-platform.txt | 1 - depends/windowsstore/p8-platform/p8-platform.txt | 1 - pvr.stalker/addon.xml.in | 2 +- pvr.stalker/changelog.txt | 3 +++ src/HTTPSocket.cpp | 4 ++-- src/SData.cpp | 6 +++--- src/XMLTV.cpp | 10 +++++----- 8 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 depends/common/p8-platform/p8-platform.txt delete mode 100644 depends/windowsstore/p8-platform/p8-platform.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a486583..58071df1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,12 +4,10 @@ project(pvr.stalker) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) find_package(Kodi REQUIRED) -find_package(p8-platform REQUIRED) find_package(LibXml2 REQUIRED) find_package(JsonCpp REQUIRED) include_directories( - ${p8-platform_INCLUDE_DIRS} ${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways ${PROJECT_SOURCE_DIR}/lib ${LIBXML2_INCLUDE_DIR} @@ -22,7 +20,6 @@ endif() add_subdirectory(lib/libstalkerclient) set(DEPLIBS - ${p8-platform_LIBRARIES} stalkerclient ${LIBXML2_LIBRARIES} ${JSONCPP_LIBRARIES}) diff --git a/depends/common/p8-platform/p8-platform.txt b/depends/common/p8-platform/p8-platform.txt deleted file mode 100644 index 98ed58a6..00000000 --- a/depends/common/p8-platform/p8-platform.txt +++ /dev/null @@ -1 +0,0 @@ -p8-platform https://github.com/xbmc/platform.git cee64e9dc0b69e8d286dc170a78effaabfa09c44 diff --git a/depends/windowsstore/p8-platform/p8-platform.txt b/depends/windowsstore/p8-platform/p8-platform.txt deleted file mode 100644 index db6f7825..00000000 --- a/depends/windowsstore/p8-platform/p8-platform.txt +++ /dev/null @@ -1 +0,0 @@ -p8-platform https://github.com/afedchin/platform.git win10 diff --git a/pvr.stalker/addon.xml.in b/pvr.stalker/addon.xml.in index 840102e0..00315550 100644 --- a/pvr.stalker/addon.xml.in +++ b/pvr.stalker/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.stalker/changelog.txt b/pvr.stalker/changelog.txt index ec9f67ab..74bfc969 100644 --- a/pvr.stalker/changelog.txt +++ b/pvr.stalker/changelog.txt @@ -1,3 +1,6 @@ +v6.0.1 +- Use kodi StringUtils and remove p8-platform dependency + v6.0.0 - PVR API 7.0.0 - Rework addon to support new API interface diff --git a/src/HTTPSocket.cpp b/src/HTTPSocket.cpp index 400bbc42..9308b9d6 100644 --- a/src/HTTPSocket.cpp +++ b/src/HTTPSocket.cpp @@ -11,7 +11,7 @@ #include "Utils.h" #include -#include +#include #define TEMP_BUFFER_SIZE 1024 @@ -43,7 +43,7 @@ void HTTPSocket::SetDefaults(Request& request) for (std::vector::iterator it = request.options.begin(); it != request.options.end(); ++it) { - if ((found = !StringUtils::CompareNoCase(it->name, option->name))) + if ((found = !kodi::tools::StringUtils::CompareNoCase(it->name, option->name))) break; } diff --git a/src/SData.cpp b/src/SData.cpp index 7464371a..a3e0534a 100644 --- a/src/SData.cpp +++ b/src/SData.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #define SERROR_MSG_UNKNOWN 30501 #define SERROR_MSG_INITIALIZE 30502 @@ -719,7 +719,7 @@ std::string SData::GetChannelStreamURL(const kodi::addon::PVRChannel& channel) c HTTPSocket sock(settings.connectionTimeout); bool failed(false); - strSplit = StringUtils::Split(chan->cmd, "/"); + strSplit = kodi::tools::StringUtils::Split(chan->cmd, "/"); if (!strSplit.empty()) { oss << m_api->GetBasePath(); @@ -730,7 +730,7 @@ std::string SData::GetChannelStreamURL(const kodi::addon::PVRChannel& channel) c if (sock.Execute(request, response)) { - strSplit = StringUtils::Split(response.body, " "); + strSplit = kodi::tools::StringUtils::Split(response.body, " "); if (!strSplit.empty()) { cmd = strSplit.back(); diff --git a/src/XMLTV.cpp b/src/XMLTV.cpp index ad38a922..a1dea3db 100644 --- a/src/XMLTV.cpp +++ b/src/XMLTV.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include XMLTV::~XMLTV() { @@ -118,7 +118,7 @@ bool XMLTV::Parse(HTTPSocket::Scope scope, const std::string& path) node3 = node3->next; } p.extra.genreType = EPGGenreByCategory(p.categories); - p.extra.genreDescription = StringUtils::Join(p.categories, ", "); + p.extra.genreDescription = kodi::tools::StringUtils::Join(p.categories, ", "); p.episodeNumber = prog->episode_num; p.previouslyShown = prog->previously_shown; @@ -171,7 +171,7 @@ XMLTV::Channel* XMLTV::GetChannelByDisplayName(std::string& displayName) dnIt = std::find_if(channel.displayNames.begin(), channel.displayNames.end(), [displayName](const std::string& dn) { - return !StringUtils::CompareNoCase(displayName, dn); + return !kodi::tools::StringUtils::CompareNoCase(displayName, dn); }); return dnIt != channel.displayNames.end(); @@ -199,7 +199,7 @@ int XMLTV::EPGGenreByCategory(std::vector& categories) gmIt = std::find_if( genreCategories.begin(), genreCategories.end(), - [category](const std::string& g) { return !StringUtils::CompareNoCase(*category, g); }); + [category](const std::string& g) { return !kodi::tools::StringUtils::CompareNoCase(*category, g); }); if (gmIt != genreCategories.end()) { @@ -256,5 +256,5 @@ std::string XMLTV::CreditsAsString(std::vector& credits, credit != filteredCredits.end(); ++credit) creditList.push_back(credit->name); - return StringUtils::Join(creditList, ", "); + return kodi::tools::StringUtils::Join(creditList, ", "); }