diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2014-12-30 19:52:21 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-13 17:29:37 +0100 |
| commit | f31ff1177eec7ffa0ea6375b77d78d69559f9c88 (patch) | |
| tree | 9e3bbb6dabbf2b082d793ca470fb8c790225663d /p2pvr/daemon/recordings.cpp | |
| parent | Don't create comically broken sample data and fix the last sample (diff) | |
| download | p2pvr-f31ff1177eec7ffa0ea6375b77d78d69559f9c88.tar.bz2 p2pvr-f31ff1177eec7ffa0ea6375b77d78d69559f9c88.tar.xz p2pvr-f31ff1177eec7ffa0ea6375b77d78d69559f9c88.zip | |
Big commit comprising mostly of changes to the DB structure to unify recorded event details into events, lots of new unit tests
Diffstat (limited to 'p2pvr/daemon/recordings.cpp')
| -rw-r--r-- | p2pvr/daemon/recordings.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/p2pvr/daemon/recordings.cpp b/p2pvr/daemon/recordings.cpp index 73cf77d..ceb89ba 100644 --- a/p2pvr/daemon/recordings.cpp +++ b/p2pvr/daemon/recordings.cpp @@ -19,11 +19,7 @@ CreateColumns<P2PVR::RecordingPtr>(const ColumnCreator & cc) cc("storageaddress", false); cc("guid", false); cc("scheduleid", false); - cc("title", false); - cc("subtitle", false); - cc("description", false); - cc("starttime", false); - cc("duration", false); + cc("eventuid", false); } template<> @@ -34,11 +30,7 @@ UnbindColumns(RowState & rs, const P2PVR::RecordingPtr & r) rs.fields[1] >> r->StorageAddress; rs.fields[2] >> r->Guid; rs.fields[3] >> r->ScheduleId; - rs.fields[4] >> r->Title; - rs.fields[5] >> r->Subtitle; - rs.fields[6] >> r->Description; - rs.fields[7] >> r->StartTime; - rs.fields[8] >> r->Duration; + rs.fields[4] >> r->EventUid; } int @@ -46,8 +38,7 @@ Recordings::NewRecording(const P2PVR::RecordingPtr & r, const Ice::Current &) { Logger()->messagebf(LOG_INFO, "%s: Creating new recording %s at %s", __PRETTY_FUNCTION__, r->Guid, r->StorageAddress); TxHelper tx(this); - auto insert = Modify(Recording_Insert, - r->StorageAddress, r->Guid, r->ScheduleId, r->Title, r->Subtitle, r->Description, r->StartTime, r->Duration); + auto insert = Modify(Recording_Insert, r->StorageAddress, r->Guid, r->ScheduleId, r->EventUid); insert.second->execute(); r->RecordingId = SelectScalar<int>(Recording_InsertNewId); Logger()->messagebf(LOG_INFO, "%s: Created recording Id: %d", __PRETTY_FUNCTION__, r->RecordingId); @@ -65,8 +56,10 @@ Recordings::DeleteRecording(int id, const Ice::Current & ice) std::string addr = recordingStorages.second / "storageaddress"; std::string guid = recordingStorages.second / "guid"; auto storage = P2PVR::StoragePrx::checkedCast(ic->stringToProxy(addr)); - storage->Delete(guid); - Logger()->messagebf(LOG_DEBUG, "%s: Delete %s from StorageAddress %s", __PRETTY_FUNCTION__, guid, addr); + if (storage) { + storage->Delete(guid); + Logger()->messagebf(LOG_DEBUG, "%s: Delete %s from StorageAddress %s", __PRETTY_FUNCTION__, guid, addr); + } } Modify(Recording_Delete, id).second->execute(); } |
