bool Dvr::DeleteRecording(int RecordedId, int chanid, const QDateTime &recstarttsRaw, bool forceDelete, bool allowRerecord) { if ((RecordedId <= 0) && (chanid <= 0 || !recstarttsRaw.isValid())) throw QString("Recorded ID or Channel ID and StartTime appears invalid."); // TODO Should use RecordingInfo ProgramInfo pi; if (RecordedId > 0) pi = ProgramInfo(RecordedId); else pi = ProgramInfo(chanid, recstarttsRaw.toUTC()); if (pi.GetChanID() && pi.HasPathname()) { QString cmd = QString("DELETE_RECORDING %1 %2 %3 %4") .arg(pi.GetChanID()) .arg(pi.GetRecordingStartTime(MythDate::ISODate)) .arg(forceDelete ? "FORCE" : "NO_FORCE") .arg(allowRerecord ? "FORGET" : "NO_FORGET"); MythEvent me(cmd); gCoreContext->dispatch(me); return true; } return false; }
bool Dvr::RemoveRecorded( int nChanId, const QDateTime &dStartTime ) { if (nChanId <= 0 || !dStartTime.isValid()) throw( QString("Channel ID or StartTime appears invalid.")); bool bResult = false; ProgramInfo *pInfo = new ProgramInfo(nChanId, dStartTime); if (pInfo->HasPathname()) bResult = RemoteDeleteRecording(nChanId, dStartTime, true, false); return bResult; }
/** \brief Returns the ProgramInfo being used by any current recording. * * Caller is responsible for deleting the ProgramInfo when done with it. */ ProgramInfo *PlaybackSock::GetRecording(uint cardid) { QStringList strlist(QString("QUERY_REMOTEENCODER %1").arg(cardid)); strlist << "GET_CURRENT_RECORDING"; if (!SendReceiveStringList(strlist)) return NULL; ProgramInfo *pginfo = new ProgramInfo(strlist); if (!pginfo->HasPathname() && !pginfo->GetChanID()) { delete pginfo; pginfo = NULL; } return pginfo; }
bool Dvr::UpdateRecordedWatchedStatus ( int RecordedId, int chanid, const QDateTime &recstarttsRaw, bool watched) { if ((RecordedId <= 0) && (chanid <= 0 || !recstarttsRaw.isValid())) throw QString("Recorded ID or Channel ID and StartTime appears invalid."); // TODO Should use RecordingInfo ProgramInfo pi; if (RecordedId > 0) pi = ProgramInfo(RecordedId); else pi = ProgramInfo(chanid, recstarttsRaw.toUTC()); if (pi.GetChanID() && pi.HasPathname()) { pi.SaveWatched(watched); return true; } return false; }