diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2014-01-29 10:45:28 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2014-01-29 10:45:28 +0100 |
commit | 6a9502ab1789ca438ebd598c004818303168e604 (patch) | |
tree | 62eaab8c2611143d0400000effc637dbfe1a40c7 /recording.c | |
parent | 9eda923269f49291317547130d24067cad9cb669 (diff) | |
download | vdr-6a9502ab1789ca438ebd598c004818303168e604.tar.gz vdr-6a9502ab1789ca438ebd598c004818303168e604.tar.bz2 |
Fixed sorting recordings by time in the Recordings menu if "Setup/OSD/Recording directories" is set to "no"
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/recording.c b/recording.c index 382a8ea2..92b2e416 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 3.13 2014/01/18 12:54:56 kls Exp $ + * $Id: recording.c 3.14 2014/01/29 10:38:46 kls Exp $ */ #include "recording.h" @@ -969,14 +969,22 @@ char *cRecording::SortName(void) const { char **sb = (RecordingsSortMode == rsmName) ? &sortBufferName : &sortBufferTime; if (!*sb) { - char *s = strdup(FileName() + strlen(cVideoDirectory::Name())); - if (RecordingsSortMode != rsmName || Setup.AlwaysSortFoldersFirst) - s = StripEpisodeName(s, RecordingsSortMode != rsmName); - strreplace(s, '/', '0'); // some locales ignore '/' when sorting - int l = strxfrm(NULL, s, 0) + 1; - *sb = MALLOC(char, l); - strxfrm(*sb, s, l); - free(s); + if (RecordingsSortMode == rsmTime && !Setup.RecordingDirs) { + char buf[32]; + struct tm tm_r; + strftime(buf, sizeof(buf), "%Y%m%d%H%I", localtime_r(&start, &tm_r)); + *sb = strdup(buf); + } + else { + char *s = strdup(FileName() + strlen(cVideoDirectory::Name())); + if (RecordingsSortMode != rsmName || Setup.AlwaysSortFoldersFirst) + s = StripEpisodeName(s, RecordingsSortMode != rsmName); + strreplace(s, '/', '0'); // some locales ignore '/' when sorting + int l = strxfrm(NULL, s, 0) + 1; + *sb = MALLOC(char, l); + strxfrm(*sb, s, l); + free(s); + } } return *sb; } |