summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2018-02-26 18:21:06 +0100
committerhorchi <vdr@jwendel.de>2018-02-26 18:21:06 +0100
commitd9d90f03128c531cd0b93cebca2af5660c2d4322 (patch)
treeefa68187a912357db99534afd35649e8d3453454 /timer.c
parent5a7781abf60c473e975674c9479006005c77d7d3 (diff)
downloadvdr-plugin-epg2vdr-d9d90f03128c531cd0b93cebca2af5660c2d4322.tar.gz
vdr-plugin-epg2vdr-d9d90f03128c531cd0b93cebca2af5660c2d4322.tar.bz2
2018-02-26 version 1.1.91 (horchi)\n - change: backward compatibility to vdr 2.2.0 - another step\n\n1.1.91vdr-2-2
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/timer.c b/timer.c
index d73f60a..f22af8f 100644
--- a/timer.c
+++ b/timer.c
@@ -24,13 +24,24 @@ int cUpdate::checkSwitchTimer()
for (auto it = switchTimers.begin(); it != switchTimers.end(); )
{
SwitchTimer* swTimer = &(it->second);
+ tChannelID channelId = tChannelID::FromString(swTimer->channelId.c_str());
+
+#if APIVERSNUM >= 20301
+ LOCK_CHANNELS_READ;
+ const cChannels* channels = Channels;
+ const cChannel* channel = channels->GetByChannelID(channelId, true);
+#else
+ cChannels* channels = &Channels;
+ cChannel* channel = channels->GetByChannelID(channelId, true);
+#endif
if (time(0) < swTimer->start)
{
if (!swTimer->notified && Epg2VdrConfig.switchTimerNotifyTime && time(0) >= swTimer->start - Epg2VdrConfig.switchTimerNotifyTime)
{
char* buf;
- asprintf(&buf, "Switching in %ld seconds to '%s'", swTimer->start-time(0), swTimer->channelId.c_str());
+ asprintf(&buf, tr("Switching in %ld seconds to '%s'"), swTimer->start-time(0),
+ channel ? channel->Name() : swTimer->channelId.c_str());
Skins.QueueMessage(mtInfo, buf);
free(buf);
swTimer->notified = yes;
@@ -40,17 +51,6 @@ int cUpdate::checkSwitchTimer()
continue;
}
- tChannelID channelId = tChannelID::FromString(swTimer->channelId.c_str());
-
-#if APIVERSNUM >= 20301
- LOCK_CHANNELS_READ;
- const cChannels* channels = Channels;
- const cChannel* channel = channels->GetByChannelID(channelId, true);
-#else
- cChannels* channels = &Channels;
- cChannel* channel = channels->GetByChannelID(channelId, true);
-#endif
-
if (!channel)
{
tell(0, "Switching to channel '%s' failed, channel not found!", swTimer->channelId.c_str());