Whenever a change is made to the recordings in the video directory, the SVDRP command UPDR is now sent to all peer VDRs

This commit is contained in:
Klaus Schmidinger 2017-06-25 12:43:09 +02:00
parent 39294e0147
commit a28d92d049
4 changed files with 23 additions and 3 deletions

View File

@ -9156,3 +9156,7 @@ Video Disk Recorder Revision History
(suggested by Frank Neumann).
- Added a note to the log, indicating that no further invalid lock sequences will be
reported until VDR is restarted.
- Whenever a change is made to the recordings in the video directory, the SVDRP command
UPDR is now sent to all peer VDRs, so that they will update their recordings list.
This is especially useful if one VDR mounts the video directory of an other one into
a subdirectory.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 4.9 2017/05/27 15:46:57 kls Exp $
* $Id: recording.c 4.10 2017/06/25 12:31:46 kls Exp $
*/
#include "recording.h"
@ -27,6 +27,7 @@
#include "remux.h"
#include "ringbuffer.h"
#include "skins.h"
#include "svdrp.h"
#include "tools.h"
#include "videodir.h"
@ -1493,6 +1494,7 @@ void cRecordings::TouchUpdate(void)
TouchFile(UpdateFileName());
if (!needsUpdate)
lastUpdate = time(NULL); // make sure we don't trigger ourselves
BroadcastSVDRPCommand("UPDR");
}
bool cRecordings::NeedsUpdate(void)

14
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 4.20 2017/05/31 14:02:17 kls Exp $
* $Id: svdrp.c 4.21 2017/06/25 12:31:13 kls Exp $
*/
#include "svdrp.h"
@ -2600,3 +2600,15 @@ bool ExecSVDRPCommand(const char *ServerName, const char *Command, cStringList *
return SVDRPClientHandler->Execute(ServerName, Command, Response);
return false;
}
void BroadcastSVDRPCommand(const char *Command)
{
cMutexLock MutexLock(&SVDRPHandlerMutex);
cStringList ServerNames;
if (SVDRPClientHandler) {
if (SVDRPClientHandler->GetServerNames(&ServerNames)) {
for (int i = 0; i < ServerNames.Size(); i++)
ExecSVDRPCommand(ServerNames[i], Command);
}
}
}

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 4.5 2015/09/09 09:44:12 kls Exp $
* $Id: svdrp.h 4.6 2017/06/25 12:27:57 kls Exp $
*/
#ifndef __SVDRP_H
@ -42,6 +42,8 @@ bool ExecSVDRPCommand(const char *ServerName, const char *Command, cStringList *
///< resulting strings from the remote VDR, which can be accessed
///< through Response. If Response is given, it will be cleared before
///< the command is actually executed.
void BroadcastSVDRPCommand(const char *Command);
///< Sends the given SVDRP Command string to all remote VDRs.
inline int SVDRPCode(const char *s) { return s ? atoi(s) : 0; }
///< Returns the value of the three digit reply code of the given
///< SVDRP response string.