Now forcing re-reading the info file of an ongoing recording

This commit is contained in:
Klaus Schmidinger
2025-04-16 09:14:20 +02:00
parent e5b8ac3370
commit 469d29005b
4 changed files with 16 additions and 13 deletions

View File

@@ -2474,6 +2474,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
tag of the 'info' file tag of the 'info' file
for adding a workaround in detecting frame height for channels with wrong crop parameters for adding a workaround in detecting frame height for channels with wrong crop parameters
for reporting duplicate component entries in the info of an ongoing recording for reporting duplicate component entries in the info of an ongoing recording
for reporting a problem where the info file of an ongoing recording was not re-read
Pekka Mauno <pekka.mauno@iki.fi> Pekka Mauno <pekka.mauno@iki.fi>
for fixing cSchedule::GetFollowingEvent() in case there is currently no present for fixing cSchedule::GetFollowingEvent() in case there is currently no present

View File

@@ -10119,8 +10119,10 @@ Video Disk Recorder Revision History
- Now deleting old recording info before reading modified info file (suggested by - Now deleting old recording info before reading modified info file (suggested by
Stefan Hofmann). Stefan Hofmann).
2025-04-15: 2025-04-16:
- Fixed some misplaced 'override' keywords in the 'hello' and 'skincurses' plugins. - Fixed some misplaced 'override' keywords in the 'hello' and 'skincurses' plugins.
- cRecording now fetches priority, lifetime and framesPerSecond from cRecordingInfo. - cRecording now fetches priority, lifetime and framesPerSecond from cRecordingInfo.
APIVERSNUM is now 30008. APIVERSNUM is now 30008.
- Now forcing re-reading the info file of an ongoing recording (reported by Christoph
Haubrich).

View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 5.40 2025/04/15 19:38:46 kls Exp $ * $Id: recording.c 5.41 2025/04/16 09:14:20 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@@ -497,13 +497,13 @@ void cRecordingInfo::SetErrors(int Errors)
errors = Errors; errors = Errors;
} }
bool cRecordingInfo::Read(FILE *f) bool cRecordingInfo::Read(FILE *f, bool Force)
{ {
if (ownEvent) { if (ownEvent) {
struct stat st; struct stat st;
if (fstat(fileno(f), &st)) if (fstat(fileno(f), &st))
return false; return false;
if (modified == st.st_mtime) if (modified == st.st_mtime && !Force)
return true; return true;
if (modified) { if (modified) {
delete ownEvent; delete ownEvent;
@@ -614,13 +614,13 @@ bool cRecordingInfo::Write(FILE *f, const char *Prefix) const
return true; return true;
} }
bool cRecordingInfo::Read(void) bool cRecordingInfo::Read(bool Force)
{ {
bool Result = false; bool Result = false;
if (fileName) { if (fileName) {
FILE *f = fopen(fileName, "r"); FILE *f = fopen(fileName, "r");
if (f) { if (f) {
if (Read(f)) if (Read(f, Force))
Result = true; Result = true;
else else
esyslog("ERROR: EPG data problem in file %s", fileName); esyslog("ERROR: EPG data problem in file %s", fileName);
@@ -1281,9 +1281,9 @@ bool cRecording::DeleteMarks(void)
return cMarks::DeleteMarksFile(this); return cMarks::DeleteMarksFile(this);
} }
void cRecording::ReadInfo(void) void cRecording::ReadInfo(bool Force)
{ {
info->Read(); info->Read(Force);
} }
bool cRecording::WriteInfo(const char *OtherFileName) bool cRecording::WriteInfo(const char *OtherFileName)
@@ -1729,7 +1729,7 @@ void cRecordings::DelByName(const char *FileName)
void cRecordings::UpdateByName(const char *FileName) void cRecordings::UpdateByName(const char *FileName)
{ {
if (cRecording *Recording = GetByName(FileName)) if (cRecording *Recording = GetByName(FileName))
Recording->ReadInfo(); Recording->ReadInfo(true);
} }
int cRecordings::TotalFileSizeMB(void) const int cRecordings::TotalFileSizeMB(void) const

View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.h 5.14 2025/04/15 19:38:46 kls Exp $ * $Id: recording.h 5.15 2025/04/16 09:14:20 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@@ -80,7 +80,7 @@ private:
char *fileName; char *fileName;
int errors; int errors;
cRecordingInfo(const cChannel *Channel = NULL, const cEvent *Event = NULL); cRecordingInfo(const cChannel *Channel = NULL, const cEvent *Event = NULL);
bool Read(FILE *f); bool Read(FILE *f, bool Force = false);
public: public:
cRecordingInfo(const char *FileName); cRecordingInfo(const char *FileName);
~cRecordingInfo(); ~cRecordingInfo();
@@ -110,7 +110,7 @@ public:
int Errors(void) const { return errors; } // returns -1 if undefined int Errors(void) const { return errors; } // returns -1 if undefined
void SetErrors(int Errors); void SetErrors(int Errors);
bool Write(FILE *f, const char *Prefix = "") const; bool Write(FILE *f, const char *Prefix = "") const;
bool Read(void); bool Read(bool Force = false);
bool Write(void) const; bool Write(void) const;
void SetData(const char *Title, const char *ShortText, const char *Description); void SetData(const char *Title, const char *ShortText, const char *Description);
void SetAux(const char *Aux); void SetAux(const char *Aux);
@@ -201,7 +201,7 @@ public:
///< Deletes the editing marks from this recording (if any). ///< Deletes the editing marks from this recording (if any).
///< Returns true if the operation was successful. If there is no marks file ///< Returns true if the operation was successful. If there is no marks file
///< for this recording, it also returns true. ///< for this recording, it also returns true.
void ReadInfo(void); void ReadInfo(bool Force = false);
bool WriteInfo(const char *OtherFileName = NULL); bool WriteInfo(const char *OtherFileName = NULL);
///< Writes in info file of this recording. If OtherFileName is given, the info ///< Writes in info file of this recording. If OtherFileName is given, the info
///< file will be written under that recording file name instead of this ///< file will be written under that recording file name instead of this