Skip to content

Commit

Permalink
Fix issue kodi-pvr#189 : "year" and "starRating" are optional in xmlt…
Browse files Browse the repository at this point in the history
…v contract
  • Loading branch information
Saad BENBOUZID committed Sep 20, 2022
1 parent ef24347 commit 3d6ba2d
Showing 1 changed file with 4 additions and 2 deletions.
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 3d6ba2d

Please sign in to comment.