Skip to content

Commit

Permalink
[PVR] Separate TV and radio recordings: Fallback: If addon does not s…
Browse files Browse the repository at this point in the history
…upply the channel type, try to obtain it from channel groups
  • Loading branch information
ksooo committed Mar 14, 2016
1 parent 83b2d7d commit e50dee7
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion xbmc/pvr/recordings/PVRRecording.cpp
Expand Up @@ -114,7 +114,34 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING &recording, unsigned int iClien
m_bIsDeleted = recording.bIsDeleted;
m_iEpgEventId = recording.iEpgEventId;
m_iChannelUid = recording.iChannelUid;
m_bRadio = recording.channelType == PVR_RECORDING_CHANNEL_TYPE_RADIO; // everything else is considered TV

// As the channel a recording was done on (probably long time ago) might no longer be
// available today prefer addon-supplied channel type (tv/radio) over channel attribute.
if (recording.channelType != PVR_RECORDING_CHANNEL_TYPE_UNKNOWN)
{
m_bRadio = recording.channelType == PVR_RECORDING_CHANNEL_TYPE_RADIO;
}
else
{
const CPVRChannelPtr channel(Channel());
if (channel)
{
m_bRadio = channel->IsRadio();
}
else
{
bool bSupportsRadio(g_PVRClients->SupportsRadio(m_iClientId));
if (bSupportsRadio && g_PVRClients->SupportsTV(m_iClientId))
{
CLog::Log(LOGWARNING,"CPVRRecording::CPVRRecording - unable to determine channel type. Defaulting to TV.");
m_bRadio = false; // Assume TV.
}
else
{
m_bRadio = bSupportsRadio;
}
}
}
}

bool CPVRRecording::operator ==(const CPVRRecording& right) const
Expand Down

0 comments on commit e50dee7

Please sign in to comment.