summaryrefslogtreecommitdiff
path: root/tasks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tasks.cpp')
-rw-r--r--tasks.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tasks.cpp b/tasks.cpp
index d7acaf3..9f20190 100644
--- a/tasks.cpp
+++ b/tasks.cpp
@@ -161,7 +161,7 @@ void BackwardRecordingTask::Action()
RecordingsManagerPtr recordings = LiveRecordingsManager();
cRecording const* recording = recordings->GetByMd5Hash( m_recording );
if ( recording == 0 ) {
- SetError( tr("Couldn't find recording or no recordings available.") );
+ SetError(tr("Couldn't find recording or no recordings available."));
return;
}
@@ -186,6 +186,27 @@ void BackwardRecordingTask::Action()
replayControl->Backward();
}
+
+void RemoveRecordingTask::Action()
+{
+ RecordingsManagerPtr recordings = LiveRecordingsManager();
+ cRecording const * recording = recordings->GetByMd5Hash( m_recording );
+ if ( recording == 0 ) {
+ SetError( tr("Couldn't find recording or no recordings available.") );
+ return;
+ }
+
+ m_recName = recording->Name();
+
+ const char *current = NowReplaying();
+ if (current && (0 == strcmp(current, recording->FileName()))) {
+ SetError(tr("Attempt to delete recording currently in playback."));
+ return;
+ }
+
+ recordings->DeleteRecording(recording);
+}
+
TaskManager::TaskManager()
{
}