Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

A couple of bug fixes #118

Merged
merged 2 commits into from

2 participants

@A600
  • Use utf-8 encoding to get and set the timers.
  • Channel names with more than 25 chars could crash the add-on.
@opdenkamp
Owner

grrr! last PR that's merged in before frodo.

@opdenkamp opdenkamp merged commit 14a1fe5 into opdenkamp:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 15, 2012
  1. @A600
  2. @A600

    [dvbviewer] Don't get the extended channel name from the root or the …

    A600 authored
    …category fields if their length is 25 chars
This page is out of date. Refresh to see the latest.
View
2  addons/pvr.dvbviewer/addon/addon.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.dvbviewer"
- version="1.6.3"
+ version="1.6.4"
name="DVBViewer Client"
provider-name="jdembski, A600">
<requires>
View
7 addons/pvr.dvbviewer/addon/changelog.txt
@@ -1,3 +1,8 @@
+1.6.4
+
+[fixed] Use utf-8 encoding to get and set the timers.
+[fixed] Channel names with more than 25 chars could crash the add-on.
+
1.6.3
[updated] Language files from Transifex
@@ -23,7 +28,6 @@ New version number by Team XBMC
[fixed] Channel names with ansi chars are converted to utf8 so they can be displayed properly (a reset of the PVR database may be required).
[fixed] Channel names with more than 25 chars.
-
0.1.5
[added] Timers support.
@@ -36,7 +40,6 @@ New version number by Team XBMC
[fixed] The preferred language is loaded from the DVBViewer config and used to get the correct EPG in case it supports multi language entries.
[fixed] When the EPG is missing the description entry, the event entry is used instead.
-
0.1.0
First version.
View
20 addons/pvr.dvbviewer/src/DvbData.cpp
@@ -229,10 +229,12 @@ bool Dvb::LoadChannels()
else
channel_pos++;
- if (strcmp(channel_group, channel->Category))
+ char channel_group_dat[26] = "";
+ strncpy(channel_group_dat, channel->Category, channel->Category_len);
+ if (strcmp(channel_group, channel_group_dat))
{
memset(channel_group, 0, sizeof(channel_group));
- strncpy(channel_group, channel->Category, channel->Category_len);
+ strncpy(channel_group, channel_group_dat, channel->Category_len);
char* strGroupNameUtf8 = XBMC->UnknownToUTF8(channel_group);
datGroup.strGroupName = strGroupNameUtf8;
groupsdat.push_back(datGroup);
@@ -258,12 +260,14 @@ bool Dvb::LoadChannels()
{
char channel_root[26] = "";
CStdString strRoot = strncpy(channel_root, channel->Root, 25);
- strChannelName.append(strRoot.substr(channel->Root_len + 1, channel->Root[channel->Root_len]));
+ if (channel->Root_len < 25)
+ strChannelName.append(strRoot.substr(channel->Root_len + 1, channel->Root[channel->Root_len]));
if (channel->Category[channel->Category_len] > 0)
{
char channel_category[26] = "";
CStdString strCategory = strncpy(channel_category, channel->Category, 25);
- strChannelName.append(strCategory.substr(channel->Category_len + 1, channel->Category[channel->Category_len]));
+ if (channel->Category_len < 25)
+ strChannelName.append(strCategory.substr(channel->Category_len + 1, channel->Category[channel->Category_len]));
}
}
}
@@ -609,7 +613,7 @@ PVR_ERROR Dvb::GetTimers(ADDON_HANDLE handle)
std::vector<DvbTimer> Dvb::LoadTimers()
{
CStdString url;
- url.Format("%s%s", m_strURL.c_str(), "api/timerlist.html");
+ url.Format("%s%s", m_strURL.c_str(), "api/timerlist.html?utf8");
CStdString strXML;
strXML = GetHttpXML(url);
@@ -740,13 +744,13 @@ void Dvb::GenerateTimer(const PVR_TIMER &timer, bool bNewTimer)
int iChannelId = m_channels.at(timer.iClientChannelUid-1).iChannelId;
CStdString strTmp;
if (bNewTimer)
- strTmp.Format("api/timeradd.html?ch=%d&dor=%d&enable=1&start=%d&stop=%d&prio=%d&days=%s&title=%s", iChannelId, dor, start, stop, timer.iPriority, strWeek, URLEncodeInline(timer.strTitle));
+ strTmp.Format("api/timeradd.html?ch=%d&dor=%d&enable=1&start=%d&stop=%d&prio=%d&days=%s&title=%s&encoding=255", iChannelId, dor, start, stop, timer.iPriority, strWeek, URLEncodeInline(timer.strTitle));
else
{
int enabled = 1;
if (timer.state == PVR_TIMER_STATE_CANCELLED)
enabled = 0;
- strTmp.Format("api/timeredit.html?id=%d&ch=%d&dor=%d&enable=%d&start=%d&stop=%d&prio=%d&days=%s&title=%s", GetTimerID(timer), iChannelId, dor, enabled, start, stop, timer.iPriority, strWeek, URLEncodeInline(timer.strTitle));
+ strTmp.Format("api/timeredit.html?id=%d&ch=%d&dor=%d&enable=%d&start=%d&stop=%d&prio=%d&days=%s&title=%s&encoding=255", GetTimerID(timer), iChannelId, dor, enabled, start, stop, timer.iPriority, strWeek, URLEncodeInline(timer.strTitle));
}
SendSimpleCommand(strTmp);
@@ -789,7 +793,7 @@ PVR_ERROR Dvb::GetRecordings(ADDON_HANDLE handle)
m_recordings.clear();
CStdString url;
- url.Format("%s%s", m_strURL.c_str(), "api/recordings.html?utf8=");
+ url.Format("%s%s", m_strURL.c_str(), "api/recordings.html?utf8");
CStdString strXML;
strXML = GetHttpXML(url);
Something went wrong with that request. Please try again.