In menu "Search Recordins" get ChannelName from 'RecInfo'

Alternatively fallback via 'ChannelID' from the active channel list.
This commit is contained in:
kamel5 2021-12-10 14:59:00 +01:00
parent 2d46769a3e
commit 6af3193b02

View File

@ -2278,15 +2278,24 @@ void cRecMenuItemRecording::Draw(void) {
if (!recording)
return;
const cRecordingInfo *recInfo = recording->Info();
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID());
#else
const cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
#endif
const cChannel *channel = NULL;
cString channelName = tr("unknown channel");
if (channel)
channelName = channel->Name();
if (recInfo) {
if (recInfo->ChannelName() && (strlen(recInfo->ChannelName()) > 0)) {
channelName = recInfo->ChannelName();
} else {
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channel = Channels->GetByChannelID(recInfo->ChannelID());
}
#else
channel = Channels.GetByChannelID(recInfo->ChannelID());
#endif
if (channel)
channelName = channel->Name();
}
}
cString name = recording->Name();
cString dateTime = cString::sprintf("%s, %s", *DateString(recording->Start()), *TimeString(recording->Start()));