From 1a16fb341aa586c80db521c12876f1d717635e63 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 18 Dec 2018 00:19:35 +0100 Subject: [PATCH] add special logo names support Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8915440aa601301a99ea6da30e54c28e08622cea Author: TangoCash Date: 2018-12-18 (Tue, 18 Dec 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 25 ++++++++++++++++++++++ src/driver/pictureviewer/pictureviewer.h | 1 + 2 files changed, 26 insertions(+) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index b5569f059..393ed361e 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -542,6 +542,16 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& char e2filename2[255]; e2filename2[0] = '\0'; + //create special filename from channelname + std::string SpecialChannelName = ChannelName; + std::transform(SpecialChannelName.begin(), SpecialChannelName.end(), SpecialChannelName.begin(), ::tolower); + SpecialChannelName = str_replace(" ","-",SpecialChannelName); + SpecialChannelName = str_replace("ä","a",SpecialChannelName); + SpecialChannelName = str_replace("ö","o",SpecialChannelName); + SpecialChannelName = str_replace("ü","u",SpecialChannelName); + SpecialChannelName = str_replace("+","___plus___",SpecialChannelName); + SpecialChannelName = str_replace("&","___and___",SpecialChannelName); + CZapitChannel * cc = NULL; if (channel_id) if (CNeutrinoApp::getInstance()->channelList) @@ -575,6 +585,11 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& id_tmp_path += ChannelName + fileType[i]; v_path.push_back(id_tmp_path); + //create filename with special channel name (logo_hdd_dir) + id_tmp_path = g_settings.logo_hdd_dir + "/"; + id_tmp_path += SpecialChannelName + fileType[i]; + v_path.push_back(id_tmp_path); + //create filename with id (logo_hdd_dir) id_tmp_path = g_settings.logo_hdd_dir + "/"; id_tmp_path += strChnId + fileType[i]; @@ -602,6 +617,11 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& id_tmp_path += ChannelName + fileType[i]; v_path.push_back(id_tmp_path); + //create filename with special channel name (LOGODIR_VAR) + id_tmp_path = LOGODIR_VAR "/"; + id_tmp_path += SpecialChannelName + fileType[i]; + v_path.push_back(id_tmp_path); + //create filename with id (LOGODIR_VAR) id_tmp_path = LOGODIR_VAR "/"; id_tmp_path += strChnId + fileType[i]; @@ -629,6 +649,11 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& id_tmp_path += ChannelName + fileType[i]; v_path.push_back(id_tmp_path); + //create filename with special channel name (LOGODIR) + id_tmp_path = LOGODIR "/"; + id_tmp_path += SpecialChannelName + fileType[i]; + v_path.push_back(id_tmp_path); + //create filename with id (LOGODIR) id_tmp_path = LOGODIR "/"; id_tmp_path += strChnId + fileType[i]; diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index 95e8aa9cc..e0b2dd3c0 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include /* printf */