Skip to content

Commit

Permalink
API3.0.0 Recording Season/Episode/Year/EpisodeName
Browse files Browse the repository at this point in the history
  • Loading branch information
metaron-uk committed Aug 22, 2015
1 parent 9383c9f commit 8823704
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/cppmyth/MythProgramInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,8 @@ uint16_t MythProgramInfo::Episode() const
{
return (m_proginfo ? m_proginfo->episode : 0);
}

time_t MythProgramInfo::Airdate() const
{
return (m_proginfo ? m_proginfo->airdate : 0);
}
1 change: 1 addition & 0 deletions src/cppmyth/MythProgramInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MythProgramInfo
std::string Inetref() const;
uint16_t Season() const;
uint16_t Episode() const;
time_t Airdate() const;

private:
Myth::ProgramPtr m_proginfo;
Expand Down
26 changes: 22 additions & 4 deletions src/pvrclient-mythtv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,19 @@ PVR_ERROR PVRClientMythTV::GetRecordings(ADDON_HANDLE handle)
//@TODO: tag.iLastPlayedPosition

std::string id = it->second.UID();
std::string title = MakeProgramTitle(it->second.Title(), it->second.Subtitle());

PVR_STRCPY(tag.strRecordingId, id.c_str());
PVR_STRCPY(tag.strTitle, title.c_str());
PVR_STRCPY(tag.strTitle, it->second.Title().c_str());
PVR_STRCPY(tag.strEpisodeName, it->second.Subtitle().c_str());
tag.iSeriesNumber = it->second.Season();
tag.iEpisodeNumber = it->second.Episode();
time_t airTime(it->second.Airdate());
if (difftime(airTime, 0) > 0)
{
struct tm airTimeDate;
localtime_r(&airTime, &airTimeDate);
tag.iYear = airTimeDate.tm_year + 1900;
}
PVR_STRCPY(tag.strPlot, it->second.Description().c_str());
PVR_STRCPY(tag.strChannelName, it->second.ChannelName().c_str());

Expand Down Expand Up @@ -949,10 +958,19 @@ PVR_ERROR PVRClientMythTV::GetDeletedRecordings(ADDON_HANDLE handle)
//@TODO: tag.iLastPlayedPosition

std::string id = it->second.UID();
std::string title = MakeProgramTitle(it->second.Title(), it->second.Subtitle());

PVR_STRCPY(tag.strRecordingId, id.c_str());
PVR_STRCPY(tag.strTitle, title.c_str());
PVR_STRCPY(tag.strTitle, it->second.Title().c_str());
PVR_STRCPY(tag.strEpisodeName, it->second.Subtitle().c_str());
tag.iSeriesNumber = it->second.Season();
tag.iEpisodeNumber = it->second.Episode();
time_t airTime(it->second.Airdate());
if (difftime(airTime, 0) > 0)
{
struct tm airTimeDate;
localtime_r(&airTime, &airTimeDate);
tag.iYear = airTimeDate.tm_year + 1900;
}
PVR_STRCPY(tag.strPlot, it->second.Description().c_str());
PVR_STRCPY(tag.strChannelName, it->second.ChannelName().c_str());

Expand Down

0 comments on commit 8823704

Please sign in to comment.