Description: Sort recordings dirs first and by name, recs by date or name
(if last char in dir is one of '.-$ª').
Author: FrankJepsen at vdrportal.de
Origin: http://www.jepsennet.de/vdr/download/11_sortrecordings.dpatch
Index: vdr/recording.c
===================================================================
--- vdr.orig/recording.c 2011-12-10 22:22:04.000000000 +0100
+++ vdr/recording.c 2011-12-11 01:48:54.000000000 +0100
@@ -811,8 +811,8 @@
s1 = t;
}
t++;
- }
- if (s1 && s2)
+ } *s1 = 255;
+ if (s1 && s2 && s1 != s && !strchr(".-$ª", *(s1 - 1)))
memmove(s1 + 1, s2, t - s2 + 1);
return s;
}
@@ -820,7 +820,7 @@
char *cRecording::SortName(void) const
{
if (!sortBuffer) {
- char *s = StripEpisodeName(strdup(FileName() + strlen(VideoDirectory) + 1));
+ char *s = StripEpisodeName(strdup(FileName() + strlen(VideoDirectory) ));
strreplace(s, '/', 'a'); // some locales ignore '/' when sorting
int l = strxfrm(NULL, s, 0) + 1;
sortBuffer = MALLOC(char, l);