Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.12 KB | None | 0 0
  1. diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
  2. index f609020..2848acf 100644
  3. --- a/src/Tvheadend.cpp
  4. +++ b/src/Tvheadend.cpp
  5. @@ -429,8 +429,14 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle )
  6. /* Setup entry */
  7. PVR_RECORDING rec = { 0 };
  8.  
  9. + /* Episode image */
  10. + if (!recording.GetImage().empty())
  11. + {
  12. + strncpy(rec.strIconPath, recording.GetImage().c_str(),
  13. + sizeof(rec.strIconPath) - 1);
  14. + }
  15. /* Channel icon */
  16. - if ((cit = m_channels.find(recording.GetChannel())) != m_channels.end())
  17. + else if ((cit = m_channels.find(recording.GetChannel())) != m_channels.end())
  18. {
  19. strncpy(rec.strIconPath, cit->second.GetIcon().c_str(),
  20. sizeof(rec.strIconPath) - 1);
  21. @@ -1094,8 +1100,8 @@ bool CTvheadend::CreateTimer ( const Recording &tvhTmr, PVR_TIMER &tmr )
  22. tmr.iEpgUid = (tvhTmr.GetEventId() > 0) ? tvhTmr.GetEventId() : PVR_TIMER_NO_EPG_UID;
  23. tmr.iMarginStart = static_cast<unsigned int>(tvhTmr.GetStartExtra());
  24. tmr.iMarginEnd = static_cast<unsigned int>(tvhTmr.GetStopExtra());
  25. - tmr.iGenreType = 0; // not supported by tvh?
  26. - tmr.iGenreSubType = 0; // not supported by tvh?
  27. + tmr.iGenreType = tvhTmr.GetGenreType();
  28. + tmr.iGenreSubType = tvhTmr.GetGenreSubType();
  29. tmr.bFullTextEpgSearch = false; // n/a for one-shot timers
  30. tmr.iParentClientIndex = tmr.iTimerType == TIMER_ONCE_CREATED_BY_TIMEREC
  31. ? m_timeRecordings.GetTimerIntIdFromStringId(tvhTmr.GetTimerecId())
  32. @@ -1394,7 +1400,7 @@ void CTvheadend::CreateEvent
  33. epg.endTime = event.GetStop();
  34. epg.strPlotOutline = event.GetSummary().c_str();
  35. epg.strPlot = event.GetDesc().c_str();
  36. - epg.strOriginalTitle = NULL; /* not supported by tvh */
  37. + epg.strOriginalTitle = event.GetOriginalTitle().c_str();
  38. epg.strCast = event.GetCast().c_str();
  39. epg.strDirector = event.GetDirectors().c_str();
  40. epg.strWriter = event.GetWriters().c_str();
  41. @@ -2460,8 +2466,10 @@ void CTvheadend::ParseRecordingAddOrUpdate ( htsmsg_t *msg, bool bAdd )
  42. // TODO: What?
  43. else if ((str = htsmsg_get_str(msg, "summary")) != NULL)
  44. rec.SetDescription(str);
  45. - if (!htsmsg_get_u32(msg, "contentType", &contentType))
  46. + if (!htsmsg_get_u32(msg, "genre", &contentType))
  47. rec.SetContentType(contentType);
  48. + if ((str = htsmsg_get_str(msg, "image")) != NULL)
  49. + rec.SetImage(str);
  50. if ((str = htsmsg_get_str(msg, "timerecId")) != NULL)
  51. rec.SetTimerecId(str);
  52. if ((str = htsmsg_get_str(msg, "autorecId")) != NULL)
  53. @@ -2606,6 +2614,8 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
  54. evt.SetNext(u32);
  55. if (!htsmsg_get_u32(msg, "contentType", &u32))
  56. evt.SetContent(u32);
  57. + if ((str = htsmsg_get_str(msg, "originalTitle")) != NULL)
  58. + evt.SetOriginalTitle(str);
  59. if (!htsmsg_get_u32(msg, "starRating", &u32))
  60. evt.SetStars(u32);
  61. if (!htsmsg_get_u32(msg, "ageRating", &u32))
  62. diff --git a/src/tvheadend/entity/Event.cpp b/src/tvheadend/entity/Event.cpp
  63. index 2c02f2b..8eeb70e 100644
  64. --- a/src/tvheadend/entity/Event.cpp
  65. +++ b/src/tvheadend/entity/Event.cpp
  66. @@ -28,20 +28,20 @@ using namespace tvheadend::entity;
  67.  
  68. void Event::SetWriters(const std::vector<std::string> &writers)
  69. {
  70. - m_writers = StringUtils::Join(writers, EPG_STRING_TOKEN_SEPARATOR);
  71. + m_writers = StringUtils::Join(writers, ", ");
  72. }
  73.  
  74. void Event::SetDirectors(const std::vector<std::string> &directors)
  75. {
  76. - m_directors = StringUtils::Join(directors, EPG_STRING_TOKEN_SEPARATOR);
  77. + m_directors = StringUtils::Join(directors, ", ");
  78. }
  79.  
  80. void Event::SetCast(const std::vector<std::string> &cast)
  81. {
  82. - m_cast = StringUtils::Join(cast, EPG_STRING_TOKEN_SEPARATOR);
  83. + m_cast = StringUtils::Join(cast, ", ");
  84. }
  85.  
  86. void Event::SetCategories(const std::vector<std::string> &categories)
  87. {
  88. - m_categories = StringUtils::Join(categories, EPG_STRING_TOKEN_SEPARATOR);
  89. + m_categories = StringUtils::Join(categories, ", ");
  90. }
  91. diff --git a/src/tvheadend/entity/Event.h b/src/tvheadend/entity/Event.h
  92. index ecf8f83..c2db677 100644
  93. --- a/src/tvheadend/entity/Event.h
  94. +++ b/src/tvheadend/entity/Event.h
  95. @@ -73,6 +73,7 @@ namespace tvheadend
  96. m_episode == other.m_episode &&
  97. m_part == other.m_part &&
  98. m_title == other.m_title &&
  99. + m_originalTitle == other.m_originalTitle &&
  100. m_subtitle == other.m_subtitle &&
  101. m_desc == other.m_desc &&
  102. m_summary == other.m_summary &&
  103. @@ -128,6 +129,9 @@ namespace tvheadend
  104.  
  105. const std::string& GetTitle() const { return m_title; }
  106. void SetTitle(const std::string &title) { m_title = title; }
  107. +
  108. + const std::string& GetOriginalTitle() const { return m_originalTitle; }
  109. + void SetOriginalTitle(const std::string &originalTitle) { m_originalTitle = originalTitle; }
  110.  
  111. const std::string& GetSubtitle() const { return m_subtitle; }
  112. void SetSubtitle(const std::string &subtitle) { m_subtitle = subtitle; }
  113. @@ -176,6 +180,7 @@ namespace tvheadend
  114. uint32_t m_episode;
  115. uint32_t m_part;
  116. std::string m_title;
  117. + std::string m_originalTitle;
  118. std::string m_subtitle; /* episode name */
  119. std::string m_desc;
  120. std::string m_summary;
  121. diff --git a/src/tvheadend/entity/Recording.h b/src/tvheadend/entity/Recording.h
  122. index 0f38527..3e7a482 100644
  123. --- a/src/tvheadend/entity/Recording.h
  124. +++ b/src/tvheadend/entity/Recording.h
  125. @@ -103,6 +103,7 @@ namespace tvheadend
  126. m_playCount == other.m_playCount &&
  127. m_playPosition == other.m_playPosition &&
  128. m_contentType == other.m_contentType &&
  129. + m_image == other.m_image &&
  130. m_season == other.m_season &&
  131. m_episode == other.m_episode &&
  132. m_part == other.m_part;
  133. @@ -218,10 +219,12 @@ namespace tvheadend
  134.  
  135. void SetContentType(uint32_t content) { m_contentType = content; }
  136. uint32_t GetContentType() const { return m_contentType; }
  137. - // tvh returns only the major DVB category for recordings in the
  138. - // bottom four bits and no sub-category
  139. - uint32_t GetGenreType() const { return m_contentType * 0x10; }
  140. - uint32_t GetGenreSubType() const { return 0; }
  141. +
  142. + uint32_t GetGenreType() const { return m_contentType & 0xF0; }
  143. + uint32_t GetGenreSubType() const { return m_contentType & 0x0F; }
  144. +
  145. + const std::string& GetImage() const { return m_image; }
  146. + void SetImage(const std::string &image) { m_image = image; }
  147.  
  148. uint32_t GetSeason() const { return m_season; }
  149. void SetSeason(uint32_t season) { m_season = season; }
  150. @@ -257,6 +260,7 @@ namespace tvheadend
  151. uint32_t m_playCount;
  152. uint32_t m_playPosition;
  153. uint32_t m_contentType;
  154. + std::string m_image;
  155. uint32_t m_season;
  156. uint32_t m_episode;
  157. uint32_t m_part;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement