diff options
| author | Felix Domke <felix.domke@multimedia-labs.de> | 2009-12-23 12:57:45 +0100 |
|---|---|---|
| committer | Felix Domke <felix.domke@multimedia-labs.de> | 2009-12-23 12:57:45 +0100 |
| commit | 2026a6353de4bb4f8586b47963282b8eb14114b1 (patch) | |
| tree | c2cecb9f15de53ee7ce7acae0b3718e696cdfcf8 /lib/service/servicemp3.cpp | |
| parent | ee9a89efd6533997e3dc9a4e8adcb360333d01d9 (diff) | |
| download | enigma2-2026a6353de4bb4f8586b47963282b8eb14114b1.tar.gz enigma2-2026a6353de4bb4f8586b47963282b8eb14114b1.zip | |
Patch by Moritz Venn:
"I've been annoyed by the incomplete "sort by date" for a long time - it only works for recorded movies.
Not much to say, I added a simple stat call in service.cpp and return the mtime for sTimeCreate so the list is as properly sorted as the dreambox can ;-)"
Minor changes so that it is implemented in servicemp3.cpp, since a service reference "path" is specific to the actual service.
Diffstat (limited to 'lib/service/servicemp3.cpp')
| -rw-r--r-- | lib/service/servicemp3.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index d3eaa262..47511f78 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -189,6 +189,25 @@ int eStaticServiceMP3Info::getLength(const eServiceReference &ref) return -1; } +int eStaticServiceMP3Info::getInfo(const eServiceReference &ref, int w) +{ + switch (w) + { + case iServiceInformation::sTimeCreate: + { + struct stat s; + if(stat(ref.path.c_str(), &s) == 0) + { + return s.st_mtime; + } + return iServiceInformation::resNA; + } + default: break; + } + return iServiceInformation::resNA; +} + + // eServiceMP3 int eServiceMP3::ac3_delay, eServiceMP3::pcm_delay; |
