Skip to content

Commit

Permalink
handle damaged recordings
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Nov 3, 2018
1 parent 441638a commit a5058f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/cppmyth/MythProgramInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,8 @@ time_t MythProgramInfo::Airdate() const
{
return (m_proginfo ? m_proginfo->airdate : 0);
}

bool MythProgramInfo::IsDamaged() const
{
return ((m_proginfo && (m_proginfo->videoProps & 0x0020)) ? true : false);
}
1 change: 1 addition & 0 deletions src/cppmyth/MythProgramInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class MythProgramInfo
uint16_t Season() const;
uint16_t Episode() const;
time_t Airdate() const;
bool IsDamaged() const;

private:
Myth::ProgramPtr m_proginfo;
Expand Down
11 changes: 10 additions & 1 deletion src/pvrclient-mythtv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,16 @@ PVR_ERROR PVRClientMythTV::GetRecordings(ADDON_HANDLE handle)

std::string id = it->second.UID();

std::string str; // a temporary string to build formating label
std::string title(it->second.Title());
if (it->second.IsDamaged())
{
str.assign(title);
title.assign("[COLOR yellow]").append(str).append("[/COLOR]");
}

PVR_STRCPY(tag.strRecordingId, id.c_str());
PVR_STRCPY(tag.strTitle, it->second.Title().c_str());
PVR_STRCPY(tag.strTitle, title.c_str());
PVR_STRCPY(tag.strEpisodeName, it->second.Subtitle().c_str());
tag.iSeriesNumber = it->second.Season();
tag.iEpisodeNumber = it->second.Episode();
Expand Down Expand Up @@ -963,6 +971,7 @@ PVR_ERROR PVRClientMythTV::GetRecordings(ADDON_HANDLE handle)
if (it->second.HasFanart())
strFanartPath = m_fileOps->GetArtworkPath(it->second, FileOps::FileTypeFanart);
}

PVR_STRCPY(tag.strIconPath, strIconPath.c_str());
PVR_STRCPY(tag.strThumbnailPath, strThumbnailPath.c_str());
PVR_STRCPY(tag.strFanartPath, strFanartPath.c_str());
Expand Down

0 comments on commit a5058f0

Please sign in to comment.