Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next

Origin commit data
------------------
Branch: ni/coolstream
Commit: ca22349f35
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-11 (Thu, 11 Aug 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-08-11 12:33:51 +02:00
3 changed files with 6 additions and 29 deletions

View File

@@ -1968,7 +1968,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
std::string extension;
extension = fname.substr(ext_pos + 1, fname.length() - ext_pos);
extension = "." + extension;
strReplace(fname, extension.c_str(), ".jpg");
str_replace(extension, ".jpg", fname);
printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str());
cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle);
if ((tmdb->getResults() > 0) && (tmdb->hasCover())) {

View File

@@ -252,7 +252,7 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end
while(_pos_ < bytes && _text_[_pos_] != '<' ) _pos_++;\
_dest_ = "";\
_dest_.append(&_text_[pos_prev],_pos_ - pos_prev );\
_dest_ = decodeXmlSpecialChars(_dest_);\
_dest_ = htmlEntityDecode(_dest_);\
_pos_ += sizeof(_tag_);\
continue;\
}
@@ -276,31 +276,6 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end
continue;\
}
void strReplace(std::string &orig, const char *fstr, const std::string &rstr)
{
// replace all occurrence of fstr with rstr and returns a reference to itself
size_t index = 0;
size_t fstrlen = strlen(fstr);
size_t rstrlen = rstr.size();
while ((index = orig.find(fstr, index)) != std::string::npos) {
orig.replace(index, fstrlen, rstr);
index += rstrlen;
}
}
std::string decodeXmlSpecialChars(std::string s)
{
strReplace(s,"&lt;","<");
strReplace(s,"&gt;",">");
strReplace(s,"&amp;","&");
strReplace(s,"&quot;","\"");
strReplace(s,"&apos;","\'");
strReplace(s,"&#x0a;","\n");
strReplace(s,"&#x0d;","\n");
return s;
}
bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
{
int bookmark_nr = 0;
@@ -408,7 +383,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
if (text[pos + pos3] == '\"')
{
audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1);
audio_pids.epgAudioPidName = decodeXmlSpecialChars(audio_pids.epgAudioPidName);
audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName);
}
}
}
@@ -456,7 +431,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
if (text[pos + pos3] == '\"')
{
movie_info->bookmarks.user[bookmark_nr].name.append(&text[pos + pos2 + 1], pos3 - pos2 - 1);
movie_info->bookmarks.user[bookmark_nr].name = decodeXmlSpecialChars(movie_info->bookmarks.user[bookmark_nr].name);
movie_info->bookmarks.user[bookmark_nr].name = htmlEntityDecode(movie_info->bookmarks.user[bookmark_nr].name);
}
}
}

View File

@@ -616,6 +616,8 @@ std::string& htmlEntityDecode(std::string& text)
};
decode_table dt[] =
{
{"\n", "&#x0a;"},
{"\n", "&#x0d;"},
{" ", "&nbsp;"},
{"&", "&amp;"},
{"<", "&lt;"},