fixed display of last recordings in main menu

This commit is contained in:
louis 2016-05-14 10:07:07 +02:00
parent f3db608253
commit b41d0f2431
3 changed files with 26 additions and 17 deletions

View File

@ -950,12 +950,23 @@ bool cVeDmLastrecordings::Parse(bool forced) {
continue;
}
#endif
string recFullPath = recording->Name() ? recording->Name() : "";
string recName = "";
string recPath = "";
RecName(recFullPath, recName, recPath);
string recSeriesName = "";
const cRecordingInfo *recInfo = recording->Info();
if (recInfo) {
recName = recInfo->Title() ? recInfo->Title() : "";
if (recInfo->Title() && recInfo->ShortText()) {
stringstream ss;
ss << recInfo->Title() << " - " << recInfo->ShortText();
recSeriesName = ss.str();
}
} else {
string recPath = recording->Name() ? recording->Name() : "";
RecName(recPath, recName);
}
if (recName.size() == 0)
recName = recording->Name() ? recording->Name() : "";
cString recDuration = cString::sprintf("%d", recording->LengthInSeconds()/60);
string posterPath = "";
int posterWidth = 0;
int posterHeight = 0;
@ -963,7 +974,7 @@ bool cVeDmLastrecordings::Parse(bool forced) {
RecPoster(recording, posterWidth, posterHeight, posterPath, hasPoster);
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::name, recName.c_str());
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::seriesname, recPath.c_str());
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::seriesname, recSeriesName.c_str());
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::date, *ShortDateString(recording->Start()));
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::time, *TimeString(recording->Start()));
tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::duration, *recDuration);
@ -981,7 +992,7 @@ bool cVeDmLastrecordings::Parse(bool forced) {
return true;
}
void cVeDmLastrecordings::RecName(string &path, string &name, string &folder) {
void cVeDmLastrecordings::RecName(string &path, string &name) {
size_t delim = path.find_last_of('~');
if (delim == string::npos) {
name = path;
@ -994,12 +1005,6 @@ void cVeDmLastrecordings::RecName(string &path, string &name, string &folder) {
if (name.find('%') == 0) {
name = name.substr(1);
}
folder = path.substr(0, delim);
size_t delim2 = folder.find_last_of('~');
if (delim2 == string::npos) {
return;
}
folder = folder.substr(delim2+1);
}
/******************************************************************
* cVeDmDetailheaderEpg

View File

@ -184,7 +184,7 @@ public:
class cVeDmLastrecordings : public cViewElement, public cScrapManager {
private:
int recIndex;
void RecName(string &path, string &name, string &folder);
void RecName(string &path, string &name);
public:
cVeDmLastrecordings(void);
virtual ~cVeDmLastrecordings(void);

View File

@ -38,10 +38,14 @@
<area condition="{numtimers}" x="2%" y="78%" width="28%" height="14%" layer="3">
<loop name="timers" x="5" y="3" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight}/3" overflow="cut">
<drawimage cache="true" name="logo" imagetype="channellogo" path="{timers[channelid]}" width="{columnwidth}*0.15" height="{rowheight}*0.75" x="10" valign="center" />
<drawtext name="datetime" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[datetime]}" />
<drawimage condition="{timers[isremotetimer]}" name="remotetimericon" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetime)} + {width(datetime)} + 10" y="0" />
<drawtext condition="{timers[isremotetimer]}" x="{posx(remotetimericon)} + {width(remotetimericon)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" />
<drawtext x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{fontdefault}" text="{timers[title]}" />
<drawtext condition="not{timers[recording]}" name="datetime" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[datetime]}" />
<drawimage condition="not{timers[recording]}++{timers[isremotetimer]}" name="remotetimericon" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetime)} + {width(datetime)} + 10" y="0" />
<drawtext condition="not{timers[recording]}++{timers[isremotetimer]}" x="{posx(remotetimericon)} + {width(remotetimericon)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" />
<drawtext condition="{timers[recording]}" name="datetimeactive" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{icontextalert}" text="{timers[datetime]}" />
<drawimage condition="{timers[recording]}++{timers[isremotetimer]}" name="remotetimericonactive" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetimeactive)} + {width(datetimeactive)} + 10" y="0" />
<drawtext condition="{timers[recording]}++{timers[isremotetimer]}" x="{posx(remotetimericonactive)} + {width(remotetimericonactive)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" />
<drawtext condition="not{timers[recording]}" x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{fontdefault}" text="{timers[title]}" />
<drawtext condition="{timers[recording]}" x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{icontextalert}" text="{timers[title]}" />
</loop>
</area>
</timers>