Skip to content

Commit

Permalink
Merge pull request #140 from phunkyfish/remove-p8platform
Browse files Browse the repository at this point in the history
Use kodi StringUtils and remove p8-platform dependency - v6.0.1
  • Loading branch information
phunkyfish authored Oct 8, 2020
2 parents f81c460 + e301675 commit 51e41d1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -22,7 +20,6 @@ endif()
add_subdirectory(lib/libstalkerclient)

set(DEPLIBS
${p8-platform_LIBRARIES}
stalkerclient
${LIBXML2_LIBRARIES}
${JSONCPP_LIBRARIES})
Expand Down
1 change: 0 additions & 1 deletion depends/common/p8-platform/p8-platform.txt

This file was deleted.

1 change: 0 additions & 1 deletion depends/windowsstore/p8-platform/p8-platform.txt

This file was deleted.

2 changes: 1 addition & 1 deletion pvr.stalker/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.stalker"
version="6.0.0"
version="6.0.1"
name="Stalker Client"
provider-name="Jamal Edey">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.stalker/changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/HTTPSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Utils.h"

#include <kodi/Filesystem.h>
#include <p8-platform/util/StringUtils.h>
#include <kodi/tools/StringUtils.h>

#define TEMP_BUFFER_SIZE 1024

Expand Down Expand Up @@ -43,7 +43,7 @@ void HTTPSocket::SetDefaults(Request& request)
for (std::vector<URLOption>::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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/SData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <chrono>
#include <cmath>
#include <kodi/General.h>
#include <p8-platform/util/StringUtils.h>
#include <kodi/tools/StringUtils.h>

#define SERROR_MSG_UNKNOWN 30501
#define SERROR_MSG_INITIALIZE 30502
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/XMLTV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <algorithm>
#include <iterator>
#include <kodi/Filesystem.h>
#include <p8-platform/util/StringUtils.h>
#include <kodi/tools/StringUtils.h>

XMLTV::~XMLTV()
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -199,7 +199,7 @@ int XMLTV::EPGGenreByCategory(std::vector<std::string>& 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())
{
Expand Down Expand Up @@ -256,5 +256,5 @@ std::string XMLTV::CreditsAsString(std::vector<Credit>& credits,
credit != filteredCredits.end(); ++credit)
creditList.push_back(credit->name);

return StringUtils::Join(creditList, ", ");
return kodi::tools::StringUtils::Join(creditList, ", ");
}

0 comments on commit 51e41d1

Please sign in to comment.