mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
infoviewer: only show remaining time if time is set
taken from martiis-neutrino-mp; based on code by seife; contains an addition to95bc39c627
Origin commit data ------------------ Branch: ni/coolstream Commit:9d25727660
Author: vanhofen <vanhofen@gmx.de> Date: 2014-05-07 (Wed, 07 May 2014) ------------------ This commit was generated by Migit
This commit is contained in:
@@ -1672,10 +1672,12 @@ void CInfoViewer::show_Data (bool calledFromEvent)
|
|||||||
if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) {
|
if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) {
|
||||||
int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60;
|
int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60;
|
||||||
int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit;
|
int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit;
|
||||||
if (jetzt < info_CurrentNext.current_zeit.startzeit) {
|
|
||||||
runningPercent = 0;
|
runningPercent = 0;
|
||||||
|
if (!gotTime)
|
||||||
|
snprintf(runningRest, sizeof(runningRest), "%d %s", info_CurrentNext.current_zeit.dauer / 60, unit_short_minute);
|
||||||
|
else if (jetzt < info_CurrentNext.current_zeit.startzeit)
|
||||||
snprintf(runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute);
|
snprintf(runningRest, sizeof(runningRest), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute);
|
||||||
} else {
|
else {
|
||||||
runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer;
|
runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer;
|
||||||
if (runningPercent > 100)
|
if (runningPercent > 100)
|
||||||
runningPercent = 100;
|
runningPercent = 100;
|
||||||
|
Reference in New Issue
Block a user