Project

General

Profile

Feature #2509 » vdr-plugin-live_2018-10-24.diff

Xcoder, 10/24/2018 11:43 PM

View differences:

pages/channels_widget.ecpp
%
% std::string listChannelId = *listChannel->GetChannelID().ToString();
<option value="<? channelid ? *listChannel->GetChannelID().ToString() ?><? !channelid ? listChannel->Number() ?>"
<{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Name() $></option>
<{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Number() $>: <$ listChannel->Name() $></option>
% }
</select>
pages/menu.ecpp
if (LiveFeatures< features::epgsearch >().Recent()) {
</%cpp>
<& menu.component current=("search") &>
<& menu.component current=("searchepg") &>
<& menu.component current=("searchtimers") &>
<%cpp>
}
pages/multischedule.ecpp
{
std::string thisChannel;
try {
if ( cur_group_count != 0 )
channel_groups_names.back() += std::string( " - " );
size_t channelSep = thisGroup.find(',');
thisChannel = thisGroup.substr(0, channelSep );
if ( cur_group_count++ != 0 )
channel_groups_names.back() += std::string( " - " );
else
channel_groups_names.back() += thisChannel += std::string( ": " );
if ( channelSep != thisGroup.npos )
thisGroup.erase( 0, channelSep+1 );
else
......
}
channel_groups_names.back() += std::string( Channel->Name() );
channel_groups_numbers.back().push_back( Channel->Number() );
cur_group_count++;
if ( cur_group_count>=MAX_CHANNELS )
{
// start new group if group gets too large
pages/recordings.ecpp
string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;");
// TRANSLATORS: recording duration format HH:MM
string duration(recItem->Duration() < 0 ? "" : FormatDuration(tr("(%d:%02d)"), recItem->Duration() / 60, recItem->Duration() % 60));
string newR(recItem->GetResume() <= 0 ? "(NEW) " : "");
string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : "");
string description(recItem->RecInfo()->Description() ? recItem->RecInfo()->Description() : "");
string hint(tr("Click to view details."));
if (!shortDescr.empty()) hint = shortDescr + "<br />" + hint;
else if (!description.empty()) hint = description + "<br />" + hint;
#ifdef HAVE_LIBPCRECPP
pcrecpp::RE re(filter.c_str(), pcrecpp::UTF8());
pcrecpp::RE re(filter.c_str(), pcrecpp::UTF8().set_caseless(true));
if (filter.empty() || re.PartialMatch(recItem->Name()) || re.PartialMatch(shortDescr) || re.PartialMatch(description))
#endif
{
</%cpp>
<li class="recording">
<& rec_item_file name=(recItem->Name()) level=(recItem->Level()) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) duration=(duration) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
<& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) duration=(duration) newR=(newR) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
</li>
<%cpp>
}
......
string duration;
string hint;
string shortDescr;
string newR;
string archived;
</%args>
<div class="recording_item">
......
<div class="recording_spec">
<div class="recording_day"><$ FormatDateTime(tr("%a,"), startTime) + string(" ") + FormatDateTime(tr("%b %d %y"), startTime) + string(" ") + FormatDateTime(tr("%I:%M %p"), startTime) $></div>
<div class="recording_duration"><$ duration $></div>
<div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span>&nbsp;</span><%cpp> } </%cpp></a></div>
<div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ newR $><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span>&nbsp;</span><%cpp> } </%cpp></a></div>
</div>
<div class="recording_actions">
<%cpp>
pages/searchresults.ecpp
using namespace vdrlive;
using namespace std;
string searchterm;
</%pre>
<%args>
// input parameters
......
<%cpp>
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
searchterm = "";
pageTitle = tr("Search results");
SearchResults results;
if (!searchtimerid.empty())
......
s.SetUseSubtitle(false);
s.SetUseDescription(false);
results.GetByQuery(s.ToText());
searchterm = searchplain;
}
</%cpp>
<& pageelems.doc_type &>
......
</head>
<body>
<& pageelems.logo &>
<& menu active=("searchepg") &>
<& menu active=("searchepg") component=("searchresults.searchresults_actions")>
<div class="inhalt">
% if (results.size() == 0) {
<$ tr("No search results") $>
......
<%include>page_exit.eh</%include>
<%def searchresults_actions>
<a href="edit_searchtimer.html?search=<$ searchterm $>"><$ tr("New search timer") $></a>
</%def>
pages/timerconflicts.ecpp
longDescription = StringEscapeAndBreak(SortedTimers::GetTimerInfo(*timer)) + "<hr>"
+ StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength))
+ "<br/><br/>" + tr("Click to view details.");
searchTimName = SortedTimers::SearchTimerName(*timer);
searchTimName = SortedTimers::SearchTimerInfo(*timer, "searchtimer");
title = epgEvent->Title();
}
</%cpp>
pages/timers.ecpp
EpgInfoPtr epgEvent;
string longDescription;
string searchTimName;
string searchTimId;
#if VDRVERSNUM >= 20301
if (!timer->Event()) {
LOCK_SCHEDULES_READ;
......
longDescription = StringEscapeAndBreak(SortedTimers::GetTimerInfo(*timer)) + "<hr>"
+ StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength))
+ "<br/><br/>" + tr("Click to view details.");
searchTimName = SortedTimers::SearchTimerName(*timer);
searchTimName = SortedTimers::SearchTimerInfo(*timer, "searchtimer");
searchTimId = SortedTimers::SearchTimerInfo(*timer, "s-id");
}
string currentDay = SortedTimers::GetTimerDays(*timer);
SortedTimers::iterator nextTimer = timer; ++nextTimer;
......
% }
><$ timer->File() $></a></div>
</td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ searchTimName $></div></td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a href="edit_searchtimer.html?searchtimerid=<$ searchTimId $>"><$ searchTimName $></a></div></td>
<td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td>
<td class="action <? bottom ? "bottomrow" ?>"><& pageelems.edit_timer timerId=(timers.GetTimerId(*timer)) &></td>
<td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td>
recman.cpp
return m_recording->LengthInSeconds() / 60;
}
long RecordingsItemRec::GetResume() const
{
if (!m_recording->FileName()) return 0;
return m_recording->GetResume();
}
/**
* Implementation of class RecordingsTree:
*/
recman.h
virtual time_t StartTime() const = 0;
virtual bool IsDir() const = 0;
virtual long Duration() const = 0;
virtual long GetResume() const = 0;
virtual const std::string& Name() const { return m_name; }
virtual const std::string Id() const = 0;
......
virtual time_t StartTime() const { return 0; }
virtual long Duration() const { return 0; }
virtual bool IsDir() const { return true; }
virtual long GetResume() const { return 0; }
virtual std::string const Id() const { return ""; }
private:
......
virtual time_t StartTime() const;
virtual long Duration() const;
virtual bool IsDir() const { return false; }
virtual long GetResume() const;
virtual const std::string Id() const { return m_id; }
virtual const cRecording* Recording() const { return m_recording; }
timers.cpp
return info.str();
}
string SortedTimers::SearchTimerName(cTimer const& timer)
string SortedTimers::SearchTimerInfo(cTimer const& timer, std::string const& value)
{
ostringstream info;
if (timer.Aux())
......
string epgsearchinfo = GetXMLValue(timer.Aux(), "epgsearch");
if (!epgsearchinfo.empty())
{
string searchtimer = GetXMLValue(epgsearchinfo, "searchtimer");
if (!searchtimer.empty())
info << searchtimer;
string data = GetXMLValue(epgsearchinfo, value);
if (!data.empty())
info << data;
}
}
return info.str();
timers.h
static std::string GetTimerDays(cTimer const& timer);
static std::string GetTimerInfo(cTimer const& timer);
static std::string SearchTimerName(cTimer const& timer);
static std::string SearchTimerInfo(cTimer const& timer, std::string const& value);
private:
SortedTimers();
(5-5/5)