summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/svdrp.c b/svdrp.c
index 5104026..a63a575 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 1.70 2005/05/06 13:47:39 kls Exp $
+ * $Id: svdrp.c 1.72 2005/05/26 09:59:09 kls Exp $
*/
#include "svdrp.h"
@@ -31,6 +31,7 @@
#include "device.h"
#include "eitscan.h"
#include "keys.h"
+#include "menu.h"
#include "remote.h"
#include "timers.h"
#include "tools.h"
@@ -214,7 +215,7 @@ const char *HelpPages[] = {
" events at the given time (which must be in time_t form).",
"LSTR [ <number> ]\n"
" List recordings. Without option, all recordings are listed. Otherwise\n"
- " the summary for the given recording is listed.",
+ " the information for the given recording is listed.",
"LSTT [ <number> ]\n"
" List timers. Without option, all timers are listed. Otherwise\n"
" only the given timer is listed.",
@@ -281,7 +282,7 @@ const char *HelpPages[] = {
/* SVDRP Reply Codes:
214 Help message
- 215 EPG data record
+ 215 EPG or recording data record
220 VDR service ready
221 VDR service closing transmission channel
250 Requested VDR action okay, completed
@@ -505,12 +506,17 @@ void cSVDRP::CmdDELR(const char *Option)
if (isnumber(Option)) {
cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
if (recording) {
- if (recording->Delete()) {
- Reply(250, "Recording \"%s\" deleted", Option);
- ::Recordings.Load(); // must make sure the global recordings list is updated
+ cRecordControl *rc = cRecordControls::GetRecordControl(recording->FileName());
+ if (!rc) {
+ if (recording->Delete()) {
+ Reply(250, "Recording \"%s\" deleted", Option);
+ ::Recordings.Load(); // must make sure the global recordings list is updated
+ }
+ else
+ Reply(554, "Error while deleting recording!");
}
else
- Reply(554, "Error while deleting recording!");
+ Reply(550, "Recording \"%s\" is in use by timer %d", Option, rc->Timer()->Index() + 1);
}
else
Reply(550, "Recording \"%s\" not found%s", Option, Recordings.Count() ? "" : " (use LSTR before deleting)");
@@ -800,13 +806,15 @@ void cSVDRP::CmdLSTR(const char *Option)
if (isnumber(Option)) {
cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
if (recording) {
- if (recording->Summary()) {
- char *summary = strdup(recording->Summary());
- Reply(250, "%s", strreplace(summary,'\n','|'));
- free(summary);
+ FILE *f = fdopen(file, "w");
+ if (f) {
+ recording->Info()->Write(f, "215-");
+ fflush(f);
+ Reply(215, "End of recording information");
+ // don't 'fclose(f)' here!
}
else
- Reply(550, "No summary available");
+ Reply(451, "Can't open file connection");
}
else
Reply(550, "Recording \"%s\" not found", Option);