moviebrowser.cpp: try to optimize "seen" tag with record settings

This commit is contained in:
2019-05-24 09:07:58 +02:00
parent 5bc7fab06c
commit 9fec21034f

View File

@@ -1950,9 +1950,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)
{