summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pages/whats_on_next.ecpp25
-rw-r--r--pages/whats_on_now.ecpp25
2 files changed, 28 insertions, 22 deletions
diff --git a/pages/whats_on_next.ecpp b/pages/whats_on_next.ecpp
index 22df5df..6145864 100644
--- a/pages/whats_on_next.ecpp
+++ b/pages/whats_on_next.ecpp
@@ -35,21 +35,24 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock);
</div>
<{
- for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
- if (!Channel->GroupSep()) {
- const cSchedule *Schedule = Schedules->GetSchedule(Channel);
- if (Schedule) {
- const cEvent *Event = Schedule->GetFollowingEvent();
- if (Event) {
- std::string title(Event->Title() ? Event->Title() : "");
- std::string short_description(Event->ShortText() ? Event->ShortText() : "");
- std::string description(Event->Description() ? Event->Description() : "");
- std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : "");
- std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : "");
+ ReadLock channelsLock( Channels );
+ if (channelsLock) {
+ for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
+ if (!Channel->GroupSep()) {
+ const cSchedule *Schedule = Schedules->GetSchedule(Channel);
+ if (Schedule) {
+ const cEvent *Event = Schedule->GetFollowingEvent();
+ if (Event) {
+ std::string title(Event->Title() ? Event->Title() : "");
+ std::string short_description(Event->ShortText() ? Event->ShortText() : "");
+ std::string description(Event->Description() ? Event->Description() : "");
+ std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : "");
+ std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : "");
}>
<& event_widget title=(title) short_description=(short_description) description=(description) channel_name=(Channel->Name()) start=(start) end=(end)>
<{
}
+ }
}
}
}
diff --git a/pages/whats_on_now.ecpp b/pages/whats_on_now.ecpp
index e0a2ba1..a79be7d 100644
--- a/pages/whats_on_now.ecpp
+++ b/pages/whats_on_now.ecpp
@@ -35,21 +35,24 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock);
</div>
<{
- for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
- if (!Channel->GroupSep()) {
- const cSchedule *Schedule = Schedules->GetSchedule(Channel);
- if (Schedule) {
- const cEvent *Event = Schedule->GetPresentEvent();
- if (Event) {
- std::string title(Event->Title() ? Event->Title() : "");
- std::string short_description(Event->ShortText() ? Event->ShortText() : "");
- std::string description(Event->Description() ? Event->Description() : "");
- std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : "");
- std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : "");
+ ReadLock channelsLock( Channels );
+ if (channelsLock) {
+ for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
+ if (!Channel->GroupSep()) {
+ const cSchedule *Schedule = Schedules->GetSchedule(Channel);
+ if (Schedule) {
+ const cEvent *Event = Schedule->GetPresentEvent();
+ if (Event) {
+ std::string title(Event->Title() ? Event->Title() : "");
+ std::string short_description(Event->ShortText() ? Event->ShortText() : "");
+ std::string description(Event->Description() ? Event->Description() : "");
+ std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : "");
+ std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : "");
}>
<& event_widget title=(title) short_description=(short_description) description=(description) channel_name=(Channel->Name()) start=(start) end=(end)>
<{
}
+ }
}
}
}