aboutsummaryrefslogtreecommitdiff
path: root/lib/service/servicedvb.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-01-11 12:50:19 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-01-11 12:50:19 +0000
commitb14f1520fe0dabd185ab3555c9d2dd8ab5276dd0 (patch)
tree709e35aec7d42c672d8aa953b52d0d7c494dd3d8 /lib/service/servicedvb.cpp
parent26ff43bdf1eb6fe4da12db2c61a63c0dcd9612c8 (diff)
downloadenigma2-b14f1520fe0dabd185ab3555c9d2dd8ab5276dd0.tar.gz
enigma2-b14f1520fe0dabd185ab3555c9d2dd8ab5276dd0.zip
filter short name brakets in getContent ('N')
add possibility to get short names with getContent ('n') the same for epg.search... filter short name brakets in Converter/ServiceName
Diffstat (limited to 'lib/service/servicedvb.cpp')
-rw-r--r--lib/service/servicedvb.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp
index 62fc0482..238f838f 100644
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -65,16 +65,7 @@ RESULT eStaticServiceDVBInformation::getName(const eServiceReference &ref, std::
if (!service_center->info(parent, service_info))
{
if (!service_info->getName(parent, name))
- {
- // just show short name
- unsigned int pos = name.find("\xc2\x86");
- if ( pos != std::string::npos )
- name.erase(0, pos+2);
- pos = name.find("\xc2\x87");
- if ( pos != std::string::npos )
- name.erase(pos);
- name+=" - ";
- }
+ name=buildShortName(name) + " - ";
}
}
}
@@ -730,6 +721,7 @@ RESULT eDVBServiceList::getContent(std::list<eServiceReference> &list, bool sort
// S = Service Reference (as python string object .. same as ref.toString())
// C = Service Reference (as python string object .. same as ref.toCompareString())
// N = Service Name (as python string object)
+// n = Short Service Name (short name brakets used) (as python string object)
// when exactly one return value per service is selected in the format string,
// then each value is directly a list entry
// when more than one value is returned per service, then the list is a list of
@@ -750,7 +742,7 @@ PyObject *eDVBServiceList::getContent(const char* format, bool sorted)
ePtr<iStaticServiceInformation> sptr;
eServiceCenterPtr service_center;
- if (strchr(format, 'N'))
+ if (strchr(format, 'N') || strchr(format, 'n'))
eServiceCenter::getPrivInstance(service_center);
ret = PyList_New(services);
@@ -782,6 +774,30 @@ PyObject *eDVBServiceList::getContent(const char* format, bool sorted)
{
std::string name;
sptr->getName(ref, name);
+
+ // filter short name brakets
+ unsigned int pos;
+ while((pos = name.find("\xc2\x86")) != std::string::npos)
+ name.erase(pos,2);
+ while((pos = name.find("\xc2\x87")) != std::string::npos)
+ name.erase(pos,2);
+
+ if (name.length())
+ tmp = PyString_FromString(name.c_str());
+ }
+ }
+ if (!tmp)
+ tmp = PyString_FromString("<n/a>");
+ break;
+ case 'n': // short service name
+ if (service_center)
+ {
+ service_center->info(ref, sptr);
+ if (sptr)
+ {
+ std::string name;
+ sptr->getName(ref, name);
+ name = buildShortName(name);
if (name.length())
tmp = PyString_FromString(name.c_str());
}