1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed the SVDRP command UPDR, which didn't update the global recordings list

This commit is contained in:
Klaus Schmidinger 2012-04-26 10:48:18 +02:00
parent b5ddaedfb3
commit 71d53f2c63
4 changed files with 19 additions and 16 deletions

View File

@ -2723,6 +2723,7 @@ Lars Hanisch <dvb@flensrocker.de>
for suggesting to assign the source character 'V' to "Analog Video"
for a patch that was used to implement SCR (Satellite Channel Routing)
for implementing the SVDRP command 'UPDR'
for reporting that the SVDRP command UPDR didn't update the global recordings list
Alex Lasnier <alex@fepg.org>
for adding tuning support for ATSC devices

View File

@ -7087,3 +7087,5 @@ Video Disk Recorder Revision History
- The Timers list is now marked as modified whenever a recording starts or ends.
- Fixed cDevice::StillPicture(), making sure it doesn't call the derived class's
function if no buffer has been allocated.
- Fixed the SVDRP command UPDR, which didn't update the global recordings list
(reported by Lars Hanisch).

28
svdrp.c
View File

@ -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 2.16 2012/03/04 12:05:56 kls Exp $
* $Id: svdrp.c 2.17 2012/04/26 10:36:11 kls Exp $
*/
#include "svdrp.h"
@ -662,14 +662,14 @@ void cSVDRP::CmdDELR(const char *Option)
{
if (*Option) {
if (isnumber(Option)) {
cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1);
if (recording) {
cRecordControl *rc = cRecordControls::GetRecordControl(recording->FileName());
if (!rc) {
if (!cCutter::Active(recording->FileName())) {
if (recording->Delete()) {
Reply(250, "Recording \"%s\" deleted", Option);
::Recordings.DelByName(recording->FileName());
Recordings.DelByName(recording->FileName());
}
else
Reply(554, "Error while deleting recording!");
@ -681,7 +681,7 @@ void cSVDRP::CmdDELR(const char *Option)
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)");
Reply(550, "Recording \"%s\" not found%s", Option, recordings.Count() ? "" : " (use LSTR before deleting)");
}
else
Reply(501, "Error in recording number \"%s\"", Option);
@ -723,7 +723,7 @@ void cSVDRP::CmdEDIT(const char *Option)
{
if (*Option) {
if (isnumber(Option)) {
cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1);
if (recording) {
cMarks Marks;
if (Marks.Load(recording->FileName(), recording->FramesPerSecond(), recording->IsPesRecording()) && Marks.Count()) {
@ -740,7 +740,7 @@ void cSVDRP::CmdEDIT(const char *Option)
Reply(554, "No editing marks defined");
}
else
Reply(550, "Recording \"%s\" not found%s", Option, Recordings.Count() ? "" : " (use LSTR before editing)");
Reply(550, "Recording \"%s\" not found%s", Option, recordings.Count() ? "" : " (use LSTR before editing)");
}
else
Reply(501, "Error in recording number \"%s\"", Option);
@ -1076,10 +1076,10 @@ void cSVDRP::CmdLSTE(const char *Option)
void cSVDRP::CmdLSTR(const char *Option)
{
bool recordings = Recordings.Update(true);
recordings.Update(true);
if (*Option) {
if (isnumber(Option)) {
cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1);
cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1);
if (recording) {
FILE *f = fdopen(file, "w");
if (f) {
@ -1097,11 +1097,11 @@ void cSVDRP::CmdLSTR(const char *Option)
else
Reply(501, "Error in recording number \"%s\"", Option);
}
else if (recordings) {
cRecording *recording = Recordings.First();
else if (recordings.Count()) {
cRecording *recording = recordings.First();
while (recording) {
Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true));
recording = Recordings.Next(recording);
Reply(recording == recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true));
recording = recordings.Next(recording);
}
}
else
@ -1367,7 +1367,7 @@ void cSVDRP::CmdPLAY(const char *Option)
char c = *option;
*option = 0;
if (isnumber(num)) {
cRecording *recording = Recordings.Get(strtol(num, NULL, 10) - 1);
cRecording *recording = recordings.Get(strtol(num, NULL, 10) - 1);
if (recording) {
if (c)
option = skipspace(++option);
@ -1389,7 +1389,7 @@ void cSVDRP::CmdPLAY(const char *Option)
Reply(250, "Playing recording \"%s\" [%s]", num, recording->Title());
}
else
Reply(550, "Recording \"%s\" not found%s", num, Recordings.Count() ? "" : " (use LSTR before playing)");
Reply(550, "Recording \"%s\" not found%s", num, recordings.Count() ? "" : " (use LSTR before playing)");
}
else
Reply(501, "Error in recording number \"%s\"", num);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: svdrp.h 2.2 2012/02/16 12:37:53 kls Exp $
* $Id: svdrp.h 2.3 2012/04/26 10:30:06 kls Exp $
*/
#ifndef __SVDRP_H
@ -43,7 +43,7 @@ class cSVDRP {
private:
cSocket socket;
cFile file;
cRecordings Recordings;
cRecordings recordings;
cPUTEhandler *PUTEhandler;
int numChars;
int length;