From 4b016691bca7290a6ad4deb57d788140f77dd1f0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 11 Mar 2018 21:53:20 +0100 Subject: [PATCH] channellist/infoviewer: align calculations for "since-time" of current event Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/61a116a2eb92d5f6cbda90483496034f40be5321 Author: vanhofen Date: 2018-03-11 (Sun, 11 Mar 2018) Origin message was: ------------------ - channellist/infoviewer: align calculations for "since-time" of current event --- src/gui/channellist.cpp | 2 +- src/gui/infoviewer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 09b1c4760..061d83791 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1571,7 +1571,7 @@ void CChannelList::paintDetails(int index) char cSeit[50] = {0}; // UTF-8 struct tm *pStartZeit = localtime(&p_event->startTime); - unsigned seit = ( time(NULL) - p_event->startTime ) / 60; + unsigned seit = (time(NULL) - p_event->startTime + 30) / 60; snprintf(cSeit, sizeof(cSeit), "%s %02d:%02d",(displayNext) ? g_Locale->getText(LOCALE_CHANNELLIST_START):g_Locale->getText(LOCALE_CHANNELLIST_SINCE), pStartZeit->tm_hour, pStartZeit->tm_min); if (displayNext) { snprintf(cNoch, sizeof(cNoch), "(%d %s)", p_event->duration / 60, unit_short_minute); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 9fe149ab5..0cd4c93bb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1969,7 +1969,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { - int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60; + unsigned seit = (jetzt - info_CurrentNext.current_zeit.startzeit + 30) / 60; int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; runningPercent = 0; if (!timeset)