From 6838b3cc24475bb3122ddd377c38b9486548e5e5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 May 2019 00:43:35 +0200 Subject: [PATCH] moviebrowser.cpp: try to optimize "seen" tag with record settings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/99c3c3b921df93aed59196efcc72bbf3a68e36ff Author: Thilo Graf Date: 2019-05-25 (Sat, 25 May 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 4554ffb26..f43d5f0dc 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1964,9 +1964,21 @@ void CMovieBrowser::refreshBrowserList(void) //P1 if (m_settings.browserRowItem[row] == MB_INFO_PERCENT_ELAPSED) { getMovieInfoItem(*m_vHandleBrowserList[handle], MB_INFO_PERCENT_ELAPSED, &string_item); + + /* + * NOTE: Get threshold offset from record safety settings to trigger the "seen" tag. + * Better solutions are welcome! + */ + int pre = 0,post = 0; + g_Timerd->getRecordingSafety(pre,post); + g_settings.record_safety_time_before = pre/60; + g_settings.record_safety_time_after = post/60; + int trigger_offset = (g_settings.record_safety_time_before + g_settings.record_safety_time_after) * m_vHandleBrowserList[handle]->length / 100; + int elapsed_percent = atoi(string_item); - string_item = ""; //not needed - if (elapsed_percent < 100) + string_item.clear(); // reset not needed + + if (elapsed_percent < 100-trigger_offset) { if (elapsed_percent > 0) {