diff --git a/HISTORY b/HISTORY index c1b1e5c9..8eaa6569 100644 --- a/HISTORY +++ b/HISTORY @@ -9578,7 +9578,7 @@ Video Disk Recorder Revision History given (reported by Manuel Reimer). - Fixed handling $(PKG_CONFIG) in newplugin (thanks to Winfried Köhler). -2021-03-16: +2021-03-17: - Fixed strreplace() to handle NULL strings (reported by Jürgen Schneider). - Somewhere down the road the 'x' bit of Doxyfile.filter got lost, so the @@ -9611,3 +9611,6 @@ Video Disk Recorder Revision History Processed(). The old functions Sync() and Repeat() are deprecated and may be removed in a future version. See the comments in filter.h for a description on how to use these new function. +- When checking whether a particular recording has already been made by a pattern + timer, the characters ' ' (blank), ':' and '-' are now ignored, making + "TITLE - EPISODE" and "TITLE: EPISODE" the same. diff --git a/MANUAL b/MANUAL index cf667665..9377f93a 100644 --- a/MANUAL +++ b/MANUAL @@ -636,6 +636,10 @@ following the matching pattern. There are three macros that can be used here: {>} everything after the matching pattern {=} the matching pattern itself (just for completeness) +As of VDR version 2.5.2, the characters ' ' (blank), ':' and '-' are ignored +when checking whether a particular recording has already been made by a pattern +timer, making "TITLE - EPISODE" and "TITLE: EPISODE" the same. + * Managing folders The "Select folder" menu, which can be accessed by pressing the "Red" key in diff --git a/recording.c b/recording.c index c1baf54e..f53d4910 100644 --- a/recording.c +++ b/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 5.5 2021/01/19 20:38:28 kls Exp $ + * $Id: recording.c 5.6 2021/03/17 10:55:43 kls Exp $ */ #include "recording.h" @@ -3115,9 +3115,32 @@ void cDoneRecordings::Append(const char *Title) } } +static const char *FuzzyChars = " -:"; + +static const char *SkipFuzzyChars(const char *s) +{ + while (*s && strchr(FuzzyChars, *s)) + s++; + return s; +} + bool cDoneRecordings::Contains(const char *Title) const { - return doneRecordings.Find(Title) >= 0; + for (int i = 0; i < doneRecordings.Size(); i++) { + const char *s = doneRecordings[i]; + const char *t = Title; + while (*s && *t) { + s = SkipFuzzyChars(s); + t = SkipFuzzyChars(t); + if (*s != *t) + break; + s++; + t++; + } + if (!*s && !*t) + return true; + } + return false; } // --- Index stuff -----------------------------------------------------------