mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
added {watched} and {percentseen} to displaymenurecordings current view
This commit is contained in:
parent
2efe2314e2
commit
5bb69c2a34
4
HISTORY
4
HISTORY
@ -400,5 +400,5 @@ Version 0.6.2
|
||||
|
||||
- added progressmodeonly viewelement in displayreplay
|
||||
- fixed bug in checking skin version
|
||||
|
||||
|
||||
- added {watched} and {percentseen} to displaymenurecordings
|
||||
current view
|
||||
|
@ -112,7 +112,7 @@
|
||||
{minutes} Duration, rest of minutes
|
||||
{elapsed} Elapsed time of current Schedule in min (0 for recordings)
|
||||
{remaining} Remaining time of current Schedule in min (0 for recordings)
|
||||
{hasPoster} true if poster is available
|
||||
{hasposter} true if poster is available
|
||||
{posterpath} Full Path of Poster to use in image path attribute
|
||||
{posterwidth} width of poster in pixel
|
||||
{posterheight} height of poster in pixel
|
||||
|
@ -58,6 +58,8 @@
|
||||
{durationeventhours} event duration, full hours
|
||||
{durationeventminutes} event duration, rest of minutes
|
||||
{new} true if recording is new
|
||||
{percentseen} percent already watched, -1 for VDR < 2.1.8
|
||||
{watched} true if percentseen > 85% including MarginStop of not cutted recording
|
||||
{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
|
||||
|
@ -512,9 +512,33 @@ bool cDisplayMenuItemCurrentRecordingView::Render(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()));
|
||||
int recDuration = usedRecording->LengthInSeconds();
|
||||
bool watched = false;
|
||||
if (usedRecording->IsEdited()) {
|
||||
if (percSeen >= 85)
|
||||
watched = true;
|
||||
} else {
|
||||
int watchedLimit = recDuration * 85 / 100 - (Setup.MarginStop + 5)*60;
|
||||
int watchedTime = percSeen * recDuration / 100;
|
||||
if (watchedLimit > 0 && watchedTime > 0 && (watchedTime > watchedLimit))
|
||||
watched = true;
|
||||
}
|
||||
intTokens.insert(pair<string,int>("watched", watched));
|
||||
|
||||
SetScraperPoster(NULL, usedRecording);
|
||||
|
||||
@ -578,7 +602,6 @@ bool cDisplayMenuItemCurrentRecordingView::Render(void) {
|
||||
intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1));
|
||||
|
||||
int duration = event->Duration() / 60;
|
||||
int recDuration = usedRecording->LengthInSeconds();
|
||||
recDuration = (recDuration>0)?(recDuration / 60):0;
|
||||
stringTokens.insert(pair<string,string>("date", recDate.c_str()));
|
||||
stringTokens.insert(pair<string,string>("time", recTime.c_str()));
|
||||
|
Loading…
Reference in New Issue
Block a user