mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
The info.vdr file now also stores the name of the channel
This commit is contained in:
11
recording.c
11
recording.c
@@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: recording.c 1.153 2007/06/16 09:36:08 kls Exp $
|
||||
* $Id: recording.c 1.154 2007/06/17 13:10:12 kls Exp $
|
||||
*/
|
||||
|
||||
#include "recording.h"
|
||||
@@ -262,6 +262,7 @@ void cResumeFile::Delete(void)
|
||||
cRecordingInfo::cRecordingInfo(const cChannel *Channel, const cEvent *Event)
|
||||
{
|
||||
channelID = Channel ? Channel->GetChannelID() : tChannelID::InvalidID;
|
||||
channelName = Channel ? strdup(Channel->Name()) : NULL;
|
||||
ownEvent = Event ? NULL : new cEvent(0);
|
||||
event = ownEvent ? ownEvent : Event;
|
||||
aux = NULL;
|
||||
@@ -304,6 +305,7 @@ cRecordingInfo::~cRecordingInfo()
|
||||
{
|
||||
delete ownEvent;
|
||||
free(aux);
|
||||
free(channelName);
|
||||
}
|
||||
|
||||
void cRecordingInfo::SetData(const char *Title, const char *ShortText, const char *Description)
|
||||
@@ -334,8 +336,11 @@ bool cRecordingInfo::Read(FILE *f)
|
||||
switch (*s) {
|
||||
case 'C': {
|
||||
char *p = strchr(t, ' ');
|
||||
if (p)
|
||||
if (p) {
|
||||
free(channelName);
|
||||
asprintf(&channelName, "%s", compactspace(p));
|
||||
*p = 0; // strips optional channel name
|
||||
}
|
||||
if (*t)
|
||||
channelID = tChannelID::FromString(t);
|
||||
}
|
||||
@@ -375,7 +380,7 @@ bool cRecordingInfo::Read(FILE *f)
|
||||
bool cRecordingInfo::Write(FILE *f, const char *Prefix) const
|
||||
{
|
||||
if (channelID.Valid())
|
||||
fprintf(f, "%sC %s\n", Prefix, *channelID.ToString());
|
||||
fprintf(f, "%sC %s%s%s\n", Prefix, *channelID.ToString(), channelName ? " " : "", channelName ? channelName : "");
|
||||
event->Dump(f, Prefix, true);
|
||||
if (aux)
|
||||
fprintf(f, "%s@ %s\n", Prefix, aux);
|
||||
|
||||
Reference in New Issue
Block a user