diff --git a/HISTORY b/HISTORY index 6bfb6f3..118914e 100644 --- a/HISTORY +++ b/HISTORY @@ -363,4 +363,6 @@ Version 0.5.2 - only close OSD when a skin is successfully updated from Git - refresh custom token display with each custom token change - +- added recording shorttext, description and scraper poster tokens + to displaymenurecordings listelement +- allow currentelements to use conditions diff --git a/displaymenu.c b/displaymenu.c index 453efd5..7a48557 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -170,6 +170,7 @@ bool cSDDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bo cDisplayMenuListView *list = rootView->GetListView(); if (!list) return false; + list->AddRecordingMenuItem(Index, Recording, Level, Total, New, Current, Selectable); if (state == vsIdle) state = vsMenuUpdate; diff --git a/dtd/displaymenu.dtd b/dtd/displaymenu.dtd index 670ef67..7bff662 100644 --- a/dtd/displaymenu.dtd +++ b/dtd/displaymenu.dtd @@ -430,6 +430,7 @@ diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c index ac1c2e7..f64d4c6 100644 --- a/libtemplate/templateview.c +++ b/libtemplate/templateview.c @@ -1245,6 +1245,7 @@ cTemplateViewMenu::cTemplateViewMenu(void) { attributes.insert("debug"); attributes.insert("delay"); attributes.insert("fadetime"); + attributes.insert("condition"); funcsAllowed.insert(pair< string, set >("currentelement", attributes)); //definition of allowed parameters for viewtab diff --git a/skins/metrixhd/xmlfiles/displaymenurecordings.xml b/skins/metrixhd/xmlfiles/displaymenurecordings.xml index c15b70d..6e8f527 100644 --- a/skins/metrixhd/xmlfiles/displaymenurecordings.xml +++ b/skins/metrixhd/xmlfiles/displaymenurecordings.xml @@ -3,6 +3,9 @@ + {hasposter} true if a scraped poster is available for recording + {posterwidth} width of scraped poster + {posterheight} height of scraped poster + {posterpath} absolute path of scraped poster + --> diff --git a/skinskeleton/xmlfiles/displaymenurecordings.xml b/skinskeleton/xmlfiles/displaymenurecordings.xml index ca2339e..15037a9 100644 --- a/skinskeleton/xmlfiles/displaymenurecordings.xml +++ b/skinskeleton/xmlfiles/displaymenurecordings.xml @@ -4,6 +4,8 @@ {nummenuitem} number of item in list, starts with 1 {name} Real Name of recording (Name of Recording Folder) {epgname} Name of recording (Name from EPG) + {shorttext} Short Text of recording + {description} Descrption of recording {date} Date of recording {time} Time of recording {daynumeric} day as number @@ -27,6 +29,10 @@ {thumbnailbwidth} width of scraped poster thumbnail {thumbnailheight} height of scraped poster thumbnail {thumbnailpath} absolute path of scraped poster thumbnail + {hasposter} true if a scraped poster is available for recording + {posterwidth} width of scraped poster + {posterheight} height of scraped poster + {posterpath} absolute path of scraped poster --> diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index fcefa2d..3e51d46 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -227,7 +227,7 @@ void cDisplayMenuItemMainView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentMainView(tmplCurrent, number, label, icon); currentView->SetPosMenuItem(pos); currentView->Start(); @@ -418,7 +418,7 @@ void cDisplayMenuItemSchedulesView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentSchedulesView(tmplCurrent, event, channel, timerMatch, cat, isEpgSearchFav); currentView->Start(); } @@ -526,7 +526,7 @@ void cDisplayMenuItemChannelsView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentChannelView(tmplCurrent, channel); currentView->Start(); } @@ -657,7 +657,7 @@ void cDisplayMenuItemTimersView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentTimerView(tmplCurrent, timer); currentView->Start(); } @@ -805,6 +805,9 @@ void cDisplayMenuItemRecordingView::SetTokens(void) { intTokens.insert(pair("durationeventhours", duration / 60)); stringTokens.insert(pair("durationeventminutes", *cString::sprintf("%.2d", duration%60))); + stringTokens.insert(pair("shorttext", info->ShortText() ? info->ShortText() : "")); + stringTokens.insert(pair("description", info->Description() ? info->Description() : "")); + static cPlugin *pScraper = GetScraperPlugin(); if (!pScraper || !usedRecording) { intTokens.insert(pair("hasposterthumbnail", false)); @@ -828,6 +831,29 @@ void cDisplayMenuItemRecordingView::SetTokens(void) { intTokens.insert(pair("thumbnailheight", -1)); stringTokens.insert(pair("thumbnailpath", "")); } + + if (!pScraper || !usedRecording) { + intTokens.insert(pair("hasposter", false)); + intTokens.insert(pair("posterwidth", -1)); + intTokens.insert(pair("posterheight", -1)); + stringTokens.insert(pair("posterpath", "")); + return; + } + + ScraperGetPoster call2; + call2.event = NULL; + call2.recording = usedRecording; + if (pScraper->Service("GetPoster", &call2)) { + intTokens.insert(pair("hasposter", FileExists(call2.poster.path))); + intTokens.insert(pair("posterwidth", call2.poster.width)); + intTokens.insert(pair("posterheight", call2.poster.height)); + stringTokens.insert(pair("posterpath", call2.poster.path)); + } else { + intTokens.insert(pair("hasposter", false)); + intTokens.insert(pair("posterwidth", -1)); + intTokens.insert(pair("posterheight", -1)); + stringTokens.insert(pair("posterpath", "")); + } } @@ -841,7 +867,7 @@ void cDisplayMenuItemRecordingView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentRecordingView(tmplCurrent, recording, level, total, newRecs); currentView->Start(); } @@ -898,7 +924,7 @@ void cDisplayMenuItemPluginView::Render(void) { if (current) { cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent(); - if (tmplCurrent) { + if (tmplCurrent && tmplCurrent->Execute()) { currentView = new cDisplayMenuItemCurrentPluginView(tmplCurrent, stringTokens, intTokens, loopTokens); currentView->Start(); }