diff options
Diffstat (limited to 'p2pvr/daemon/schedules.cpp')
-rw-r--r-- | p2pvr/daemon/schedules.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp index f70d44d..dfd7220 100644 --- a/p2pvr/daemon/schedules.cpp +++ b/p2pvr/daemon/schedules.cpp @@ -11,6 +11,8 @@ #include "resources.h" #include <boost/date_time/posix_time/posix_time.hpp> #include <instanceStore.impl.h> +#include "sqlSelectDeserializer.h" +#include <slicer/slicer.h> ResourceString(Schedules_getCandidates, sql_Schedules_getCandidates); ResourceString(Schedules_insert, sql_Schedules_insert); @@ -431,18 +433,17 @@ Schedules::DeleteSchedule(int id, const Ice::Current & ice) P2PVR::ScheduleList Schedules::GetSchedules(const Ice::Current &) { - P2PVR::ScheduleList schedules; - SqlContainerCreator<P2PVR::ScheduleList, P2PVR::Schedule> cct(schedules); - cct.populate(Select(Schedules_selectAll).second); - return schedules; + Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__); + return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduleList>( + *Select(Schedules_selectAll).second); } P2PVR::SchedulePtr Schedules::GetSchedule(int id, const Ice::Current &) { - P2PVR::ScheduleList schedules; - SqlContainerCreator<P2PVR::ScheduleList, P2PVR::Schedule> cct(schedules); - cct.populate(Select(Schedules_selectById, id).second); + Logger()->messagebf(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id); + auto schedules = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduleList>( + *Select(Schedules_selectById, id).second); if (schedules.empty()) throw P2PVR::NotFound(); return schedules.front(); } @@ -450,10 +451,9 @@ Schedules::GetSchedule(int id, const Ice::Current &) P2PVR::ScheduledToRecordList Schedules::GetScheduledToRecord(const Ice::Current &) { - P2PVR::ScheduledToRecordList scheduled; - SqlContainerCreator<P2PVR::ScheduledToRecordList, P2PVR::ScheduledToRecord> cct(scheduled); - cct.populate(Select(Schedules_scheduledToRecord).second); - return scheduled; + Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__); + return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduledToRecordList>( + *Select(Schedules_scheduledToRecord).second); } int |