Skip to content

Commit 5d70b48

Browse files
authored
Merge pull request #191 from Macadoshis/fix/189-nexus
(Nexus) Fix issue #189 : "year" and "starRating" are optional in xmltv contract
2 parents a9b88cc + 7b364bd commit 5d70b48

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

lib/libstalkerclient/xmltv.c

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include "util.h"
2929

30+
#include <kodi/c-api/addon-instance/pvr/pvr_epg.h>
31+
3032
void *sc_xmltv_create(enum sc_xmltv_strct type) {
3133
size_t size = 0;
3234
void *strct = NULL;
@@ -60,6 +62,7 @@ void *sc_xmltv_create(enum sc_xmltv_strct type) {
6062
sc_xmltv_programme_t *p = (sc_xmltv_programme_t *) strct;
6163
p->credits = sc_list_create();
6264
p->categories = sc_list_create();
65+
p->episode_num = EPG_TAG_INVALID_SERIES_EPISODE;
6366
break;
6467
}
6568
default:

pvr.stalker/addon.xml.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon
33
id="pvr.stalker"
4-
version="20.3.0"
4+
version="20.3.1"
55
name="Stalker Client"
66
provider-name="Jamal Edey">
77
<requires>@ADDON_DEPENDS@</requires>

pvr.stalker/changelog.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v20.3.1
2+
- Fix issue #189 : "year" and "starRating" are optional in xmltv contract
3+
- Fix issue : init episodeNumber to undefined instead of "0"
4+
15
v20.3.0
26
- Kodi inputstream API update to version 3.2.0
37
- Kodi PVR API update to version 8.0.2

src/GuideManager.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@ int GuideManager::AddEvents(
183183
e.cast = p->extra.cast;
184184
e.directors = p->extra.directors;
185185
e.writers = p->extra.writers;
186-
e.year = std::stoi(p->date.substr(0, 4));
186+
if (!p->date.empty())
187+
e.year = std::stoi(p->date.substr(0, 4));
187188
e.iconPath = p->icon;
188189
e.genreType = p->extra.genreType;
189190
e.genreDescription = p->extra.genreDescription;
190191
e.firstAired = p->previouslyShown;
191-
e.starRating = std::stoi(p->starRating.substr(0, 1));
192+
if (!p->starRating.empty())
193+
e.starRating = std::stoi(p->starRating.substr(0, 1));
192194
e.episodeNumber = p->episodeNumber;
193195
e.episodeName = p->subTitle;
194196

0 commit comments

Comments
 (0)