|
1 |
| -#include <vector> |
2 |
| -#include <algorithm> |
3 |
| -#include <vdr/channels.h> |
4 |
| -#include <vdr/plugin.h> |
5 |
| -#include <iomanip> |
6 |
| -#include "epgsearch/services.h" |
7 | 1 | #include "epgsearch.h"
|
8 |
| -#include "tools.h" |
9 |
| -#include <ostream> |
10 |
| -#include <sstream> |
11 |
| -#include <istream> |
12 |
| -#include <set> |
13 |
| -#include <stdexcept> |
| 2 | + |
| 3 | + |
| 4 | +void operator<<= (cxxtools::SerializationInfo& si, SerSearchTimerContainer s) |
| 5 | +{ |
| 6 | + si.addMember("id") <<= s.timer->Id(); |
| 7 | + si.addMember("search") <<= StringExtension::UTF8Decode(s.timer->Search()); |
| 8 | + si.addMember("mode") <<= s.timer->SearchMode(); |
| 9 | + si.addMember("tolerance") <<= s.timer->Tolerance(); |
| 10 | + si.addMember("match_case") <<= s.timer->MatchCase(); |
| 11 | + si.addMember("use_time") <<= s.timer->UseTime(); |
| 12 | + si.addMember("use_title") <<= s.timer->UseTitle(); |
| 13 | + si.addMember("use_subtitle") <<= s.timer->UseSubtitle(); |
| 14 | + si.addMember("use_description") <<= s.timer->UseDescription(); |
| 15 | + si.addMember("start_time") <<= s.timer->StartTime(); |
| 16 | + si.addMember("stop_time") <<= s.timer->StopTime(); |
| 17 | + si.addMember("use_channel") <<= s.timer->UseChannel(); |
| 18 | + si.addMember("channel_min") <<= (const char*)s.timer->ChannelMin().ToString(); |
| 19 | + si.addMember("channel_max") <<= (const char*)s.timer->ChannelMax().ToString(); |
| 20 | + si.addMember("channels") <<= s.timer->ChannelText(); |
| 21 | + si.addMember("use_as_searchtimer") <<= s.timer->UseAsSearchTimer(); |
| 22 | + si.addMember("use_duration") <<= s.timer->UseDuration(); |
| 23 | + si.addMember("duration_min") <<= s.timer->MinDuration(); |
| 24 | + si.addMember("duration_max") <<= s.timer->MaxDuration(); |
| 25 | + si.addMember("use_dayofweek") <<= s.timer->UseDayOfWeek(); |
| 26 | + si.addMember("dayofweek") <<= s.timer->DayOfWeek(); |
| 27 | + si.addMember("use_in_favorites") <<= s.timer->UseInFavorites(); |
| 28 | + si.addMember("search_timer_action") <<= s.timer->SearchTimerAction(); |
| 29 | + si.addMember("use_series_recording") <<= s.timer->UseSeriesRecording(); |
| 30 | + si.addMember("directory") <<= s.timer->Directory(); |
| 31 | + si.addMember("del_recs_after_days") <<= s.timer->DelRecsAfterDays(); |
| 32 | + si.addMember("keep_recs") <<= s.timer->KeepRecs(); |
| 33 | + si.addMember("pause_on_recs") <<= s.timer->PauseOnRecs(); |
| 34 | + si.addMember("blacklist_mode") <<= s.timer->BlacklistMode(); |
| 35 | + si.addMember("switch_min_before") <<= s.timer->SwitchMinBefore(); |
| 36 | + si.addMember("use_ext_epg_info") <<= s.timer->UseExtEPGInfo(); |
| 37 | + si.addMember("ext_epg_info") <<= s.timer->ExtEPGInfo(); |
| 38 | + si.addMember("avoid_repeats") <<= s.timer->AvoidRepeats(); |
| 39 | + si.addMember("allowed_repeats") <<= s.timer->AllowedRepeats(); |
| 40 | + si.addMember("repeats_within_days") <<= s.timer->RepeatsWithinDays(); |
| 41 | + si.addMember("compare_title") <<= s.timer->CompareTitle(); |
| 42 | + si.addMember("compare_subtitle") <<= s.timer->CompareSubtitle(); |
| 43 | + si.addMember("compare_summary") <<= s.timer->CompareSummary(); |
| 44 | + si.addMember("compare_categories") <<= s.timer->CompareCategories(); |
| 45 | + si.addMember("priority") <<= s.timer->Priority(); |
| 46 | + si.addMember("lifetime") <<= s.timer->Lifetime(); |
| 47 | + si.addMember("margin_start") <<= s.timer->MarginStart(); |
| 48 | + si.addMember("margin_stop") <<= s.timer->MarginStop(); |
| 49 | + si.addMember("use_vps") <<= s.timer->UseVPS(); |
| 50 | + si.addMember("del_mode") <<= s.timer->DelMode(); |
| 51 | + si.addMember("del_after_count_recs") <<= s.timer->DelAfterCountRecs(); |
| 52 | + si.addMember("del_after_days_of_first_rec") <<= s.timer->DelAfterDaysOfFirstRec(); |
| 53 | +} |
14 | 54 |
|
15 | 55 | namespace vdrlive {
|
16 | 56 |
|
17 | 57 | using namespace std;
|
18 | 58 |
|
| 59 | +std::string SearchTimer::ToXml() |
| 60 | +{ |
| 61 | + std::ostringstream s; |
| 62 | + s << "<searchtimer>\n" |
| 63 | + << "<id>" << Id() << "</id>\n" |
| 64 | + << "<search>" << StringExtension::encodeToXml(Search()) << "</search>\n" |
| 65 | + << "<mode>" << SearchMode() << "</mode>\n" |
| 66 | + << "<tolerance>" << Tolerance() << "</tolerance>\n" |
| 67 | + << "<match_case>" << MatchCase() << "</match_case>\n" |
| 68 | + << "<use_time>" << UseTime() << "</use_time>\n" |
| 69 | + << "<use_title>" << UseTitle() << "</use_title>\n" |
| 70 | + << "<use_subtitle>" << UseSubtitle() << "</use_subtitle>\n" |
| 71 | + << "<start_time>" << StartTime() << "</start_time>\n" |
| 72 | + << "<stop_time>" << StopTime() << "</stop_time>\n" |
| 73 | + << "<use_channel>" << UseChannel() << "</use_channel>\n" |
| 74 | + << "<channel_min>" << ChannelMin() << "</channel_min>\n" |
| 75 | + << "<channel_max>" << ChannelMax() << "</channel_max>\n" |
| 76 | + << "<channels>" << ChannelText() << "</channels>\n" |
| 77 | + << "<use_as_searchtimer>" << UseAsSearchTimer() << "</use_as_searchtimer>\n" |
| 78 | + << "<use_duration>" << UseDuration() << "</use_duration>\n" |
| 79 | + << "<duration_min>" << MinDuration() << "</duration_min>\n" |
| 80 | + << "<duration_max>" << MaxDuration() << "</duration_max>\n" |
| 81 | + << "<use_dayofweek>" << UseDayOfWeek() << "</use_dayofweek>\n" |
| 82 | + << "<dayofweek>" << DayOfWeek() << "</dayofweek>\n" |
| 83 | + << "<use_in_favorites>" << UseInFavorites() << "</use_in_favorites>\n" |
| 84 | + << "<directory>" << Directory() << "</directory>\n" |
| 85 | + << "<del_recs_after_days>" << DelRecsAfterDays() << "</del_recs_after_days>\n" |
| 86 | + << "<keep_recs>" << KeepRecs() << "</keep_recs>\n" |
| 87 | + << "<pause_on_recs>" << PauseOnRecs() << "</pause_on_recs>\n" |
| 88 | + << "<blacklist_mode>" << BlacklistMode() << "</blacklist_mode>\n" |
| 89 | + << "<switch_min_before>" << SwitchMinBefore() << "</switch_min_before>\n" |
| 90 | + << "<use_ext_epg_info>" << UseExtEPGInfo() << "</use_ext_epg_info>\n" |
| 91 | + << "<ext_epg_info>\n"; |
| 92 | + std::vector< std::string > epg_infos = ExtEPGInfo(); |
| 93 | + for (int i=0;i<(int)epg_infos.size();i++) |
| 94 | + { |
| 95 | + s << " <info>" << epg_infos[i] << "</info>\n"; |
| 96 | + } |
| 97 | + s << "</ext_epg_info>\n" |
| 98 | + << "<avoid_repeats>" << AvoidRepeats() << "</avoid_repeats>\n" |
| 99 | + << "<allowed_repeats>" << AllowedRepeats() << "</allowed_repeats>\n" |
| 100 | + << "<repeats_within_days>" << RepeatsWithinDays() << "</repeats_within_days>\n" |
| 101 | + << "<compare_title>" << CompareTitle() << "</compare_title>\n" |
| 102 | + << "<compare_subtitle>" << CompareSubtitle() << "</compare_subtitle>\n" |
| 103 | + << "<compare_summary>" << CompareSummary() << "</compare_summary>\n" |
| 104 | + << "<compare_categories>" << CompareCategories() << "</compare_categories>\n" |
| 105 | + << "<priority>" << Priority() << "</priority>\n" |
| 106 | + << "<lifetime>" << Lifetime() << "</lifetime>\n" |
| 107 | + << "<margin_start>" << MarginStart() << "</margin_start>\n" |
| 108 | + << "<margin_stop>" << MarginStop() << "</margin_stop>\n" |
| 109 | + << "<use_vps>" << UseVPS() << "</use_vps>\n" |
| 110 | + << "<del_mode>" << DelMode() << "</del_mode>\n" |
| 111 | + << "<del_after_count_recs>" << DelAfterCountRecs() << "</del_after_count_recs>\n" |
| 112 | + << "<del_after_days_of_first_rec>" << DelAfterDaysOfFirstRec() << "</del_after_days_of_first_rec>\n" |
| 113 | + << "</searchtimer>\n"; |
| 114 | + |
| 115 | + return s.str(); |
| 116 | +} |
| 117 | + |
| 118 | +std::string SearchTimer::ToHtml() |
| 119 | +{ |
| 120 | + return Search(); |
| 121 | +} |
| 122 | + |
19 | 123 | istream& operator>>( istream& is, tChannelID& ret )
|
20 | 124 | {
|
21 | 125 | string line;
|
@@ -338,7 +442,7 @@ SearchTimers::SearchTimers()
|
338 | 442 | bool SearchTimers::Reload()
|
339 | 443 | {
|
340 | 444 | Epgsearch_services_v1_0 service;
|
341 |
| - |
| 445 | + cPluginManager::CallFirstService(ServiceInterface, &service); |
342 | 446 | ReadLock channelsLock( Channels, 0 );
|
343 | 447 | list< string > timers = service.handler->SearchTimerList();
|
344 | 448 | m_timers.assign( timers.begin(), timers.end() );
|
@@ -608,5 +712,5 @@ std::string EPGSearchExpr::EvaluateExpr(const std::string& expr, const cEvent* e
|
608 | 712 | }
|
609 | 713 |
|
610 | 714 |
|
611 |
| -} // namespace vdrlivea |
| 715 | +} // namespace vdrlive |
612 | 716 |
|
0 commit comments