Skip to content

Commit

Permalink
Merge pull request #131 from phunkyfish/season-invalid
Browse files Browse the repository at this point in the history
Update PVR API 6.2.0
  • Loading branch information
phunkyfish authored Mar 17, 2020
2 parents c9ae0fb + 6603b29 commit e972981
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/libstalkerclient/xmltv.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void sc_xmltv_free(enum sc_xmltv_strct type, void *strct) {

sc_list_free(&p->categories, true);

p->episode_num = 0;
p->episode_num = -1;
p->previously_shown = 0;
if (p->star_rating) free(p->star_rating);
p->star_rating = NULL;
Expand Down
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="4.1.2"
version="4.1.3"
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 @@
v4.1.3
- Update PVR API 6.2.0

4.1.2
- Updated language files from Transifex
- Replace AppVeyor with Azure for test build (better performance)
Expand Down
2 changes: 1 addition & 1 deletion src/GuideManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace SC {
std::string genreDescription;
time_t firstAired = 0;
int starRating = 0;
int episodeNumber = 0;
int episodeNumber = EPG_TAG_INVALID_SERIES_EPISODE;
std::string episodeName;
};

Expand Down
19 changes: 18 additions & 1 deletion src/SData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,20 @@ SError SData::Authenticate() {
return SERROR_OK;
}

namespace
{

std::string ParseAsW3CDateString(time_t time)
{
std::tm* tm = std::localtime(&time);
char buffer[16];
std::strftime(buffer, 16, "%Y-%m-%d", tm);

return buffer;
}

} // unnamed namespace

PVR_ERROR SData::GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t start, time_t end) {
XBMC->Log(LOG_DEBUG, "%s", __FUNCTION__);

Expand Down Expand Up @@ -353,9 +367,12 @@ PVR_ERROR SData::GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t s
tag.iGenreType = event->genreType;
if (tag.iGenreType == EPG_GENRE_USE_STRING)
tag.strGenreDescription = event->genreDescription.c_str();
tag.firstAired = event->firstAired;
std::string strFirstAired(event->firstAired > 0 ? ParseAsW3CDateString(event->firstAired) : "");
tag.strFirstAired = strFirstAired.c_str();
tag.iStarRating = event->starRating;
tag.iSeriesNumber = EPG_TAG_INVALID_SERIES_EPISODE;
tag.iEpisodeNumber = event->episodeNumber;
tag.iEpisodePartNumber = EPG_TAG_INVALID_SERIES_EPISODE;
tag.strEpisodeName = event->episodeName.c_str();
tag.iFlags = EPG_TAG_FLAG_UNDEFINED;

Expand Down

0 comments on commit e972981

Please sign in to comment.