diff --git a/HISTORY b/HISTORY index 375e574..b154fdc 100644 --- a/HISTORY +++ b/HISTORY @@ -253,3 +253,5 @@ Version 0.3.3 any list menu, implementation in displaymenu.xml is default - use recording info for viewelement in main menu if recording is replayed. New token {islivetv} indicates this. +- added Token {percentseen} to listelements in menurecordings. For + VDR Version < 2.1.8 {percentseen} is set to -1. diff --git a/skins/metrixhd/xmlfiles/displaymenurecordings.xml b/skins/metrixhd/xmlfiles/displaymenurecordings.xml index f0bf9aa..c15b70d 100644 --- a/skins/metrixhd/xmlfiles/displaymenurecordings.xml +++ b/skins/metrixhd/xmlfiles/displaymenurecordings.xml @@ -16,6 +16,7 @@ {durationeventminutes} event duration, rest of minutes {current} true if item is currently selected {new} true if recording is new + {percentseen} percent already watched, -1 for VDR < 2.1.8 {cutted} true if recording is cutted {folder} true if item is a folder {numrecordingsfolder} if item is a folder, number of recordings in this folder diff --git a/skinskeleton/xmlfiles/displaymenurecordings.xml b/skinskeleton/xmlfiles/displaymenurecordings.xml index 3e66746..76631bf 100644 --- a/skinskeleton/xmlfiles/displaymenurecordings.xml +++ b/skinskeleton/xmlfiles/displaymenurecordings.xml @@ -17,6 +17,7 @@ {durationeventminutes} event duration, rest of minutes {current} true if item is currently selected {new} true if recording is new + {percentseen} percent already watched, -1 for VDR < 2.1.8 {cutted} true if recording is cutted {folder} true if item is a folder {numrecordingsfolder} if item is a folder, number of recordings in this folder diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index 1e3a667..c0d3b42 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -690,6 +690,19 @@ void cDisplayMenuItemRecordingView::SetTokens(void) { stringTokens.insert(pair("name", buffer.c_str())); intTokens.insert(pair("new", usedRecording->IsNew())); + + int percSeen = 0; +#if APIVERSNUM < 20108 + percSeen = -1; +#else + percSeen = 0; + int framesSeen = usedRecording->GetResume(); + int framesTotal = usedRecording->NumFrames(); + if (framesTotal > 0) { + percSeen = (double)framesSeen / (double)framesTotal * 100; + } +#endif + intTokens.insert(pair("percentseen", percSeen)); intTokens.insert(pair("newrecordingsfolder", newRecs)); intTokens.insert(pair("numrecordingsfolder", total)); intTokens.insert(pair("cutted", usedRecording->IsEdited()));