Skip to content

Commit

Permalink
Merge pull request #190 from Macadoshis/fix/189
Browse files Browse the repository at this point in the history
(Matrix) Fix issue #189 : "year" and "starRating" are optional in xmltv contract
  • Loading branch information
phunkyfish authored Sep 21, 2022
2 parents 7bc8857 + e1231a3 commit 6a19b99
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/libstalkerclient/xmltv.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include "util.h"

#include <kodi/addon-instance/pvr/EPG.h>

void *sc_xmltv_create(enum sc_xmltv_strct type) {
size_t size = 0;
void *strct = NULL;
Expand Down Expand Up @@ -60,6 +62,7 @@ void *sc_xmltv_create(enum sc_xmltv_strct type) {
sc_xmltv_programme_t *p = (sc_xmltv_programme_t *) strct;
p->credits = sc_list_create();
p->categories = sc_list_create();
p->episode_num = EPG_TAG_INVALID_SERIES_EPISODE;
break;
}
default:
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="19.0.3"
version="19.0.4"
name="Stalker Client"
provider-name="Jamal Edey">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
4 changes: 4 additions & 0 deletions pvr.stalker/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v19.0.4
- Fix issue #189 : "year" and "starRating" are optional in xmltv contract
- Fix issue : init episodeNumber to undefined instead of "0"

v19.0.3
- Fix libxml2 dependency for Windows/UWP/Xbox

Expand Down
6 changes: 4 additions & 2 deletions src/GuideManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ int GuideManager::AddEvents(
e.cast = p->extra.cast;
e.directors = p->extra.directors;
e.writers = p->extra.writers;
e.year = std::stoi(p->date.substr(0, 4));
if (!p->date.empty())
e.year = std::stoi(p->date.substr(0, 4));
e.iconPath = p->icon;
e.genreType = p->extra.genreType;
e.genreDescription = p->extra.genreDescription;
e.firstAired = p->previouslyShown;
e.starRating = std::stoi(p->starRating.substr(0, 1));
if (!p->starRating.empty())
e.starRating = std::stoi(p->starRating.substr(0, 1));
e.episodeNumber = p->episodeNumber;
e.episodeName = p->subTitle;

Expand Down

0 comments on commit 6a19b99

Please sign in to comment.