added Token {percentseen} to listelements in menurecordings

This commit is contained in:
louis 2015-04-01 10:36:48 +02:00
parent b98fee9668
commit 495c222234
4 changed files with 17 additions and 0 deletions

View File

@ -253,3 +253,5 @@ Version 0.3.3
any list menu, implementation in displaymenu.xml is default
- use recording info for <currentschedule> 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.

View File

@ -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

View File

@ -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

View File

@ -690,6 +690,19 @@ void cDisplayMenuItemRecordingView::SetTokens(void) {
stringTokens.insert(pair<string,string>("name", buffer.c_str()));
intTokens.insert(pair<string,int>("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<string,int>("percentseen", percSeen));
intTokens.insert(pair<string,int>("newrecordingsfolder", newRecs));
intTokens.insert(pair<string,int>("numrecordingsfolder", total));
intTokens.insert(pair<string,int>("cutted", usedRecording->IsEdited()));