diff --git a/epgsearch.cpp b/epgsearch.cpp index 48e7fbf..f021ea0 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -410,6 +410,15 @@ SearchTimer* SearchTimers::GetByTimerId( std::string const& id ) } +SearchTimer* SearchTimers::GetBySearch( std::string const& s ) +{ + for (SearchTimers::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer) + if (!timer->Search().compare(s)) + return &*timer; + return NULL; + +} + bool SearchTimers::ToggleActive(std::string const& id) { SearchTimer* search = GetByTimerId( id ); diff --git a/epgsearch.h b/epgsearch.h index c5f81e6..56c3bd8 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -284,6 +284,7 @@ public: iterator end() { return m_timers.end(); } const_iterator end() const { return m_timers.end(); } SearchTimer* GetByTimerId( std::string const& id ); + SearchTimer* GetBySearch( std::string const& s ); bool ToggleActive(std::string const& id); bool Delete(std::string const& id); void TriggerUpdate(); diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index f575f15..e69f3bb 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -42,6 +42,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); % % std::string listChannelId = *listChannel->GetChannelID().ToString(); + <{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Number() $>: <$ listChannel->Name() $> % } diff --git a/pages/multischedule.ecpp b/pages/multischedule.ecpp index d06ac44..6754958 100644 --- a/pages/multischedule.ecpp +++ b/pages/multischedule.ecpp @@ -115,10 +115,12 @@ std::vector times_start; { 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 @@ -136,7 +138,6 @@ std::vector times_start; } 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 diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 9ef8a0a..4d02464 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -262,19 +262,20 @@ for (recIter = recItems.begin(); recIter != recItems.end(); ++recIter) { string dayLen(lexical_cast(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 + "
" + hint; else if (!description.empty()) hint = description + "
" + 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 {
  • - <& 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())) &>
  • <%cpp> } @@ -379,6 +380,7 @@ for (recIter = recItems.begin(); recIter != recItems.end(); ++recIter) { string duration; string hint; string shortDescr; + string newR; string archived;
    @@ -386,7 +388,7 @@ for (recIter = recItems.begin(); recIter != recItems.end(); ++recIter) {
    <%cpp> diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 7b7be70..b61963b 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -79,6 +79,7 @@ static const size_t maximumDescriptionLength = 300; EpgInfoPtr epgEvent; string longDescription; string searchTimName; + int searchTimId = 0; #if VDRVERSNUM >= 20301 if (!timer->Event()) { LOCK_SCHEDULES_READ; @@ -94,6 +95,7 @@ static const size_t maximumDescriptionLength = 300; + StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) + "

    " + tr("Click to view details."); searchTimName = SortedTimers::SearchTimerName(*timer); + if (!searchTimName.empty()) searchTimId = SortedTimers::SearchTimerId(*timer); } string currentDay = SortedTimers::GetTimerDays(*timer); SortedTimers::iterator nextTimer = timer; ++nextTimer; @@ -157,7 +159,7 @@ static const size_t maximumDescriptionLength = 300; % } ><$ timer->File() $>
    - ">
    <$ searchTimName $>
    + "> ">Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>> "><& pageelems.edit_timer timerId=(timers.GetTimerId(*timer)) &> ">" alt="" <& tooltip.hint text=(tr("Delete timer")) &>> diff --git a/recman.cpp b/recman.cpp index 7bd7912..4dc816c 100644 --- a/recman.cpp +++ b/recman.cpp @@ -431,6 +431,12 @@ namespace vdrlive { return m_recording->LengthInSeconds() / 60; } + long RecordingsItemRec::GetResume() const + { + if (!m_recording->FileName()) return 0; + return m_recording->GetResume(); + } + /** * Implementation of class RecordingsTree: */ diff --git a/recman.h b/recman.h index c5a5fbb..dabbb4f 100644 --- a/recman.h +++ b/recman.h @@ -171,6 +171,7 @@ namespace vdrlive { 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; @@ -203,6 +204,7 @@ namespace vdrlive { 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: @@ -225,6 +227,7 @@ namespace vdrlive { 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; } diff --git a/timers.cpp b/timers.cpp index 98e4ad8..7122799 100644 --- a/timers.cpp +++ b/timers.cpp @@ -1,5 +1,6 @@ #include "timers.h" +#include "epgsearch.h" #include "exception.h" #include "tools.h" @@ -162,6 +163,15 @@ namespace vdrlive { return info.str(); } + int SortedTimers::SearchTimerId(cTimer const& timer) + { + string st = SortedTimers::SearchTimerName(timer); + SearchTimers stimers; + SearchTimer* search = stimers.GetBySearch(st); + if (search) return search->Id(); + return 0; + } + #if VDRVERSNUM >= 20301 bool SortedTimers::Modified() { diff --git a/timers.h b/timers.h index 30583f3..5942e50 100644 --- a/timers.h +++ b/timers.h @@ -30,6 +30,7 @@ namespace vdrlive { static std::string GetTimerDays(cTimer const& timer); static std::string GetTimerInfo(cTimer const& timer); static std::string SearchTimerName(cTimer const& timer); + static int SearchTimerId(cTimer const& timer); private: SortedTimers();