diff options
-rw-r--r-- | p2pvr/daemon/recordings.cpp | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/p2pvr/daemon/recordings.cpp b/p2pvr/daemon/recordings.cpp index ceb89ba..e3e92a0 100644 --- a/p2pvr/daemon/recordings.cpp +++ b/p2pvr/daemon/recordings.cpp @@ -4,6 +4,8 @@ #include <Ice/Ice.h> #include <logger.h> #include "sqlContainerCreator.h" +#include <slicer/slicer.h> +#include "sqlSelectDeserializer.h" ResourceString(Recording_Insert, sql_Recordings_insert); ResourceString(Recording_InsertNewId, sql_Recordings_insertNewId); @@ -11,28 +13,6 @@ ResourceString(Recording_Delete, sql_Recordings_delete); ResourceString(Recording_GetStorage, sql_Recordings_getStorage); ResourceString(Recording_GetAll, sql_Recordings_getAll); -template<> -void -CreateColumns<P2PVR::RecordingPtr>(const ColumnCreator & cc) -{ - cc("recordingid", true); - cc("storageaddress", false); - cc("guid", false); - cc("scheduleid", false); - cc("eventuid", false); -} - -template<> -void -UnbindColumns(RowState & rs, const P2PVR::RecordingPtr & r) -{ - rs.fields[0] >> r->RecordingId; - rs.fields[1] >> r->StorageAddress; - rs.fields[2] >> r->Guid; - rs.fields[3] >> r->ScheduleId; - rs.fields[4] >> r->EventUid; -} - int Recordings::NewRecording(const P2PVR::RecordingPtr & r, const Ice::Current &) { @@ -67,9 +47,8 @@ Recordings::DeleteRecording(int id, const Ice::Current & ice) P2PVR::RecordingList Recordings::GetRecordings(const Ice::Current &) { - P2PVR::RecordingList rtn; - SqlContainerCreator<P2PVR::RecordingList, P2PVR::Recording> cc(rtn); - cc.populate(Select(Recording_GetAll).second); - return rtn; + Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__); + return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::RecordingList>( + *Select(Recording_GetAll).second); } |