Repository: xbmc/xbmc
File: xbmc/pvr/addons/PVRClient.cpp (C++)

Code before:
    iLifetime = recording.LifeTime();
    iGenreType = recording.GenreType();
    iGenreSubType = recording.GenreSubType();
    iPlayCount = recording.GetLocalPlayCount();
    iLastPlayedPosition = std::lrint(recording.GetLocalResumePoint().timeInSeconds);
    bIsDeleted = recording.IsDeleted();
    iEpgEventId = recording.BroadcastUid();
    iChannelUid = recording.ChannelUid();
    channelType =
        recording.IsRadio() ? PVR_RECORDING_CHANNEL_TYPE_RADIO : PVR_RECORDING_CHANNEL_TYPE_TV;
    strFirstAired = m_firstAired.c_str();
    iFlags = recording.Flags();
    sizeInBytes = recording.GetSizeInBytes();
    strProviderName = m_providerName.c_str();
    iClientProviderUid = recording.ClientProviderUniqueId();
    strParentalRatingCode = m_parentalRatingCode.c_str();
    strParentalRatingIcon = m_parentalRatingIcon.c_str();
    strParentalRatingSource = m_parentalRatingSource.c_str();
  }
  virtual ~CAddonRecording() = default;

private:
  const std::string m_recordingId;
  const std::string m_title;
  const std::string m_episodeName;
  int m_episodePartNumber;
  const std::string m_directory;
  const std::string m_plotOutline;
  const std::string m_plot;
  const std::string m_genreDescription;
  const std::string m_channelName;
  const std::string m_iconPath;
  const std::string m_thumbnailPath;
  const std::string m_fanartPath;
  const std::string m_firstAired;
  const std::string m_providerName;
  const std::string m_parentalRatingCode;
  const std::string m_parentalRatingIcon;
  const std::string m_parentalRatingSource;
};

class CAddonTimer : public PVR_TIMER
{
public:
  explicit CAddonTimer(const CPVRTimerInfoTag& timer)
    : m_title(timer.Title()),
      m_epgSearchString(timer.EpgSearchString()),
      m_directory(timer.Directory()),
      m_summary(timer.Summary()),
      m_seriesLink(timer.SeriesLink())
  {

Review comment (refactor):
Please remove this line. A member is only needed for `const char*`API struct members.

Code after:
    iLifetime = recording.LifeTime();
    iGenreType = recording.GenreType();
    iGenreSubType = recording.GenreSubType();
    iPlayCount = recording.GetLocalPlayCount();
    iLastPlayedPosition = std::lrint(recording.GetLocalResumePoint().timeInSeconds);
    bIsDeleted = recording.IsDeleted();
    iEpgEventId = recording.BroadcastUid();
    iChannelUid = recording.ChannelUid();
    channelType =
        recording.IsRadio() ? PVR_RECORDING_CHANNEL_TYPE_RADIO : PVR_RECORDING_CHANNEL_TYPE_TV;
    strFirstAired = m_firstAired.c_str();
    iFlags = recording.Flags();
    sizeInBytes = recording.GetSizeInBytes();
    strProviderName = m_providerName.c_str();
    iClientProviderUid = recording.ClientProviderUniqueId();
    strParentalRatingCode = m_parentalRatingCode.c_str();
    strParentalRatingIcon = m_parentalRatingIcon.c_str();
    strParentalRatingSource = m_parentalRatingSource.c_str();
  }
  virtual ~CAddonRecording() = default;

private:
  const std::string m_recordingId;
  const std::string m_title;
  const std::string m_episodeName;
  const std::string m_directory;
  const std::string m_plotOutline;
  const std::string m_plot;
  const std::string m_genreDescription;
  const std::string m_channelName;
  const std::string m_iconPath;
  const std::string m_thumbnailPath;
  const std::string m_fanartPath;
  const std::string m_firstAired;
  const std::string m_providerName;
  const std::string m_parentalRatingCode;
  const std::string m_parentalRatingIcon;
  const std::string m_parentalRatingSource;
};

class CAddonTimer : public PVR_TIMER
{
public:
  explicit CAddonTimer(const CPVRTimerInfoTag& timer)
    : m_title(timer.Title()),
      m_epgSearchString(timer.EpgSearchString()),
      m_directory(timer.Directory()),
      m_summary(timer.Summary()),
      m_seriesLink(timer.SeriesLink())
  {
    time_t start;