vdr-1.7.30 & call cmd after a recording is deleted
Commit Message
Hi,
attached is a patch which extends the cmd call function to: if a recording
is deleted.
The cmd call 'edited' where not mentioned, which I now did.
Would be nice, if it find's a way into the main vdr.
Alexander
Comments
On 11.09.2012 09:29, hondansx@gmx.de wrote:
> Hi,
>
> attached is a patch which extends the cmd call function to: if a recording
> is deleted.
> The cmd call 'edited' where not mentioned, which I now did.
>
> Would be nice, if it find's a way into the main vdr.
What would this be good for?
Klaus
| On 11.09.2012 09:29, hondansx@gmx.de wrote:
|> Hi,
|>
|> attached is a patch which extends the cmd call function to: if a
|> recording
|> is deleted.
|> The cmd call 'edited' where not mentioned, which I now did.
|>
|> Would be nice, if it find's a way into the main vdr.
|
| What would this be good for?
If a recording is deleted, you could do everything you want.
For example:
rename, restore, move it to another location in condition this is a
important/not seen or a autocut+deleted recording.
I use vdr in a server environment with multiple clients and I will get
noticed if somebody deletes anything.
So I assume this make more sense in a server environment. ;-)
Alexander
Hi Klaus,
I would like this function, too.
Because I have a script, which converts VDR-recordings to smaller mp4
for my mobile.
And with that vdr-cmd-script, running after a recording was deleted, it
would be possible to delete the associated mp4-file automatically.
Greetings,
Stephan.
Am 09/11/12 09:41, schrieb Klaus Schmidinger:
> On 11.09.2012 09:29, hondansx@gmx.de wrote:
>> Hi,
>>
>> attached is a patch which extends the cmd call function to: if a
>> recording
>> is deleted.
>> The cmd call 'edited' where not mentioned, which I now did.
>>
>> Would be nice, if it find's a way into the main vdr.
>
> What would this be good for?
>
> Klaus
Alexander Wenzel, <HondaNSX@Gmx.de>
call CMD after a recording where deleted
@@ -1010,8 +1010,10 @@ bool cRecording::Delete(void)
RemoveVideoFile(NewName);
}
isyslog("deleting recording '%s'", FileName());
- if (access(FileName(), F_OK) == 0)
+ if (access(FileName(), F_OK) == 0) {
result = RenameVideoFile(FileName(), NewName);
+ cRecordingUserCommand::InvokeCommand(RUC_DELETERECORDING, NewName);
+ }
else {
isyslog("recording '%s' vanished", FileName());
result = true; // well, we were going to delete it, anyway
@@ -240,6 +240,7 @@ public:
#define RUC_BEFORERECORDING "before"
#define RUC_AFTERRECORDING "after"
#define RUC_EDITEDRECORDING "edited"
+#define RUC_DELETERECORDING "deleted"
class cRecordingUserCommand {
private:
@@ -466,7 +466,7 @@ int main(int argc, char *argv[])
" -p PORT, --port=PORT use PORT for SVDRP (default: %d)\n"
" 0 turns off SVDRP\n"
" -P OPT, --plugin=OPT load a plugin defined by the given options\n"
- " -r CMD, --record=CMD call CMD before and after a recording\n"
+ " -r CMD, --record=CMD call CMD before, after, edited or delete a recording\n"
" --resdir=DIR read resource files from DIR (default: %s)\n"
" -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
" --split split edited files at the editing marks (only\n"