Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
- index f609020..2848acf 100644
- --- a/src/Tvheadend.cpp
- +++ b/src/Tvheadend.cpp
- @@ -429,8 +429,14 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle )
- /* Setup entry */
- PVR_RECORDING rec = { 0 };
- + /* Episode image */
- + if (!recording.GetImage().empty())
- + {
- + strncpy(rec.strIconPath, recording.GetImage().c_str(),
- + sizeof(rec.strIconPath) - 1);
- + }
- /* Channel icon */
- - if ((cit = m_channels.find(recording.GetChannel())) != m_channels.end())
- + else if ((cit = m_channels.find(recording.GetChannel())) != m_channels.end())
- {
- strncpy(rec.strIconPath, cit->second.GetIcon().c_str(),
- sizeof(rec.strIconPath) - 1);
- @@ -1094,8 +1100,8 @@ bool CTvheadend::CreateTimer ( const Recording &tvhTmr, PVR_TIMER &tmr )
- tmr.iEpgUid = (tvhTmr.GetEventId() > 0) ? tvhTmr.GetEventId() : PVR_TIMER_NO_EPG_UID;
- tmr.iMarginStart = static_cast<unsigned int>(tvhTmr.GetStartExtra());
- tmr.iMarginEnd = static_cast<unsigned int>(tvhTmr.GetStopExtra());
- - tmr.iGenreType = 0; // not supported by tvh?
- - tmr.iGenreSubType = 0; // not supported by tvh?
- + tmr.iGenreType = tvhTmr.GetGenreType();
- + tmr.iGenreSubType = tvhTmr.GetGenreSubType();
- tmr.bFullTextEpgSearch = false; // n/a for one-shot timers
- tmr.iParentClientIndex = tmr.iTimerType == TIMER_ONCE_CREATED_BY_TIMEREC
- ? m_timeRecordings.GetTimerIntIdFromStringId(tvhTmr.GetTimerecId())
- @@ -1394,7 +1400,7 @@ void CTvheadend::CreateEvent
- epg.endTime = event.GetStop();
- epg.strPlotOutline = event.GetSummary().c_str();
- epg.strPlot = event.GetDesc().c_str();
- - epg.strOriginalTitle = NULL; /* not supported by tvh */
- + epg.strOriginalTitle = event.GetOriginalTitle().c_str();
- epg.strCast = event.GetCast().c_str();
- epg.strDirector = event.GetDirectors().c_str();
- epg.strWriter = event.GetWriters().c_str();
- @@ -2460,8 +2466,10 @@ void CTvheadend::ParseRecordingAddOrUpdate ( htsmsg_t *msg, bool bAdd )
- // TODO: What?
- else if ((str = htsmsg_get_str(msg, "summary")) != NULL)
- rec.SetDescription(str);
- - if (!htsmsg_get_u32(msg, "contentType", &contentType))
- + if (!htsmsg_get_u32(msg, "genre", &contentType))
- rec.SetContentType(contentType);
- + if ((str = htsmsg_get_str(msg, "image")) != NULL)
- + rec.SetImage(str);
- if ((str = htsmsg_get_str(msg, "timerecId")) != NULL)
- rec.SetTimerecId(str);
- if ((str = htsmsg_get_str(msg, "autorecId")) != NULL)
- @@ -2606,6 +2614,8 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
- evt.SetNext(u32);
- if (!htsmsg_get_u32(msg, "contentType", &u32))
- evt.SetContent(u32);
- + if ((str = htsmsg_get_str(msg, "originalTitle")) != NULL)
- + evt.SetOriginalTitle(str);
- if (!htsmsg_get_u32(msg, "starRating", &u32))
- evt.SetStars(u32);
- if (!htsmsg_get_u32(msg, "ageRating", &u32))
- diff --git a/src/tvheadend/entity/Event.cpp b/src/tvheadend/entity/Event.cpp
- index 2c02f2b..8eeb70e 100644
- --- a/src/tvheadend/entity/Event.cpp
- +++ b/src/tvheadend/entity/Event.cpp
- @@ -28,20 +28,20 @@ using namespace tvheadend::entity;
- void Event::SetWriters(const std::vector<std::string> &writers)
- {
- - m_writers = StringUtils::Join(writers, EPG_STRING_TOKEN_SEPARATOR);
- + m_writers = StringUtils::Join(writers, ", ");
- }
- void Event::SetDirectors(const std::vector<std::string> &directors)
- {
- - m_directors = StringUtils::Join(directors, EPG_STRING_TOKEN_SEPARATOR);
- + m_directors = StringUtils::Join(directors, ", ");
- }
- void Event::SetCast(const std::vector<std::string> &cast)
- {
- - m_cast = StringUtils::Join(cast, EPG_STRING_TOKEN_SEPARATOR);
- + m_cast = StringUtils::Join(cast, ", ");
- }
- void Event::SetCategories(const std::vector<std::string> &categories)
- {
- - m_categories = StringUtils::Join(categories, EPG_STRING_TOKEN_SEPARATOR);
- + m_categories = StringUtils::Join(categories, ", ");
- }
- diff --git a/src/tvheadend/entity/Event.h b/src/tvheadend/entity/Event.h
- index ecf8f83..c2db677 100644
- --- a/src/tvheadend/entity/Event.h
- +++ b/src/tvheadend/entity/Event.h
- @@ -73,6 +73,7 @@ namespace tvheadend
- m_episode == other.m_episode &&
- m_part == other.m_part &&
- m_title == other.m_title &&
- + m_originalTitle == other.m_originalTitle &&
- m_subtitle == other.m_subtitle &&
- m_desc == other.m_desc &&
- m_summary == other.m_summary &&
- @@ -128,6 +129,9 @@ namespace tvheadend
- const std::string& GetTitle() const { return m_title; }
- void SetTitle(const std::string &title) { m_title = title; }
- +
- + const std::string& GetOriginalTitle() const { return m_originalTitle; }
- + void SetOriginalTitle(const std::string &originalTitle) { m_originalTitle = originalTitle; }
- const std::string& GetSubtitle() const { return m_subtitle; }
- void SetSubtitle(const std::string &subtitle) { m_subtitle = subtitle; }
- @@ -176,6 +180,7 @@ namespace tvheadend
- uint32_t m_episode;
- uint32_t m_part;
- std::string m_title;
- + std::string m_originalTitle;
- std::string m_subtitle; /* episode name */
- std::string m_desc;
- std::string m_summary;
- diff --git a/src/tvheadend/entity/Recording.h b/src/tvheadend/entity/Recording.h
- index 0f38527..3e7a482 100644
- --- a/src/tvheadend/entity/Recording.h
- +++ b/src/tvheadend/entity/Recording.h
- @@ -103,6 +103,7 @@ namespace tvheadend
- m_playCount == other.m_playCount &&
- m_playPosition == other.m_playPosition &&
- m_contentType == other.m_contentType &&
- + m_image == other.m_image &&
- m_season == other.m_season &&
- m_episode == other.m_episode &&
- m_part == other.m_part;
- @@ -218,10 +219,12 @@ namespace tvheadend
- void SetContentType(uint32_t content) { m_contentType = content; }
- uint32_t GetContentType() const { return m_contentType; }
- - // tvh returns only the major DVB category for recordings in the
- - // bottom four bits and no sub-category
- - uint32_t GetGenreType() const { return m_contentType * 0x10; }
- - uint32_t GetGenreSubType() const { return 0; }
- +
- + uint32_t GetGenreType() const { return m_contentType & 0xF0; }
- + uint32_t GetGenreSubType() const { return m_contentType & 0x0F; }
- +
- + const std::string& GetImage() const { return m_image; }
- + void SetImage(const std::string &image) { m_image = image; }
- uint32_t GetSeason() const { return m_season; }
- void SetSeason(uint32_t season) { m_season = season; }
- @@ -257,6 +260,7 @@ namespace tvheadend
- uint32_t m_playCount;
- uint32_t m_playPosition;
- uint32_t m_contentType;
- + std::string m_image;
- uint32_t m_season;
- uint32_t m_episode;
- uint32_t m_part;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement