Skip to content

Commit

Permalink
Merge pull request #4 from margro/pvr_api_update
Browse files Browse the repository at this point in the history
Sync with API 1.9.6
  • Loading branch information
hudokkow committed Mar 31, 2015
2 parents f1c1f06 + de42da8 commit 6f8ca82
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pvr.mediaportal.tvserver/addon.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.mediaportal.tvserver"
version="1.10.3"
version="1.10.4"
name="MediaPortal PVR Client"
provider-name="Marcel Groothuis">
<requires>
<c-pluff version="0.1"/>
<import addon="xbmc.pvr" version="1.9.5"/>
<import addon="xbmc.pvr" version="1.9.6"/>
<import addon="xbmc.gui" version="5.8.0"/>
</requires>
<extension
Expand Down
4 changes: 4 additions & 0 deletions pvr.mediaportal.tvserver/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.10.4
- Updated to PVR API v1.9.6
- Recordings: set recording thumbnail path if found on the backend (only TSReader)

v1.10.3
- Move tsreader sources into the MPTV namespace to prevent a crash on RPi when using the FileReader class.
Kodi now has an internal FileReader class (since xbmc/xbmc/pull/6306) which is somehow used by the addon instead of the class in the addon.
Expand Down
24 changes: 21 additions & 3 deletions src/pvrclient-mediaportal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using namespace MPTV;
int g_iTVServerXBMCBuild = 0;

/* PVR client version (don't forget to update also the addon.xml and the Changelog.txt files) */
#define PVRCLIENT_MEDIAPORTAL_VERSION_STRING "1.10.3"
#define PVRCLIENT_MEDIAPORTAL_VERSION_STRING "1.10.4"

/* TVServerXBMC plugin supported versions */
#define TVSERVERXBMC_MIN_VERSION_STRING "1.1.7.107"
Expand Down Expand Up @@ -996,11 +996,29 @@ PVR_ERROR cPVRClientMediaPortal::GetRecordings(ADDON_HANDLE handle)
PVR_STRCLR(tag.strDirectory);
}

std::string recordingUri(ToXBMCPath(recording.FilePath()));

if (g_bUseRTSP == false)
{
/* Recording thumbnail */
CStdString strThumbnailName(recordingUri);
strThumbnailName.Replace(".ts", ".jpg");

if (XBMC->FileExists(strThumbnailName.c_str(), false))
{
PVR_STRCPY(tag.strThumbnailPath, strThumbnailName.c_str());
}
else
{
PVR_STRCLR(tag.strThumbnailPath);
}
}

#ifdef TARGET_WINDOWS
if ( (g_bUseRTSP == false) && (recording.IsRecording() == false) && (OS::CFile::Exists( recording.FilePath() )))
if ((g_bUseRTSP == false) && (recording.IsRecording() == false) && (OS::CFile::Exists(recording.FilePath())))
{
// Direct access. Bypass the PVR addon completely (both ffmpeg and TSReader mode; Windows only)
PVR_STRCPY(tag.strStreamURL, ToXBMCPath(recording.FilePath()).c_str());
PVR_STRCPY(tag.strStreamURL, recordingUri.c_str());
}
else
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ std::string ToThumbFileName(const char* strChannelName)

std::string ToXBMCPath(const std::string& strFileName)
{
CStdString strXBMCFileName = strFileName;
CStdString strXBMCFileName(strFileName);

if (strXBMCFileName.Left(2) == "\\\\")
{
CStdString SMBPrefix = "smb://";
std::string SMBPrefix = "smb://";

if (g_szSMBusername.length() > 0)
{
Expand All @@ -125,9 +125,9 @@ std::string ToXBMCPath(const std::string& strFileName)
}
SMBPrefix += "@";
}
strXBMCFileName.Replace("\\\\", SMBPrefix);
strXBMCFileName.Replace("\\\\", SMBPrefix.c_str());
strXBMCFileName.Replace('\\', '/');
}
strXBMCFileName.Replace('\\', '/');

return strXBMCFileName;
}
Expand Down

0 comments on commit 6f8ca82

Please sign in to comment.