From: Felix Domke Date: Wed, 23 Dec 2009 11:57:45 +0000 (+0100) Subject: Patch by Moritz Venn: X-Git-Tag: 2.7.0~6^2 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/2026a6353de4bb4f8586b47963282b8eb14114b1 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. --- 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; diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index 985179f6..56a068b9 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -41,6 +41,7 @@ class eStaticServiceMP3Info: public iStaticServiceInformation public: RESULT getName(const eServiceReference &ref, std::string &name); int getLength(const eServiceReference &ref); + int getInfo(const eServiceReference &ref, int w); }; typedef struct _GstElement GstElement;