mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
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:
@@ -1968,7 +1968,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
|
|||||||
std::string extension;
|
std::string extension;
|
||||||
extension = fname.substr(ext_pos + 1, fname.length() - ext_pos);
|
extension = fname.substr(ext_pos + 1, fname.length() - ext_pos);
|
||||||
extension = "." + extension;
|
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());
|
printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str());
|
||||||
cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle);
|
cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle);
|
||||||
if ((tmdb->getResults() > 0) && (tmdb->hasCover())) {
|
if ((tmdb->getResults() > 0) && (tmdb->hasCover())) {
|
||||||
|
@@ -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_++;\
|
while(_pos_ < bytes && _text_[_pos_] != '<' ) _pos_++;\
|
||||||
_dest_ = "";\
|
_dest_ = "";\
|
||||||
_dest_.append(&_text_[pos_prev],_pos_ - pos_prev );\
|
_dest_.append(&_text_[pos_prev],_pos_ - pos_prev );\
|
||||||
_dest_ = decodeXmlSpecialChars(_dest_);\
|
_dest_ = htmlEntityDecode(_dest_);\
|
||||||
_pos_ += sizeof(_tag_);\
|
_pos_ += sizeof(_tag_);\
|
||||||
continue;\
|
continue;\
|
||||||
}
|
}
|
||||||
@@ -276,31 +276,6 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end
|
|||||||
continue;\
|
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,"<","<");
|
|
||||||
strReplace(s,">",">");
|
|
||||||
strReplace(s,"&","&");
|
|
||||||
strReplace(s,""","\"");
|
|
||||||
strReplace(s,"'","\'");
|
|
||||||
strReplace(s,"
","\n");
|
|
||||||
strReplace(s,"
","\n");
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
|
bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
|
||||||
{
|
{
|
||||||
int bookmark_nr = 0;
|
int bookmark_nr = 0;
|
||||||
@@ -408,7 +383,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info)
|
|||||||
if (text[pos + pos3] == '\"')
|
if (text[pos + pos3] == '\"')
|
||||||
{
|
{
|
||||||
audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1);
|
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] == '\"')
|
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.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -616,6 +616,8 @@ std::string& htmlEntityDecode(std::string& text)
|
|||||||
};
|
};
|
||||||
decode_table dt[] =
|
decode_table dt[] =
|
||||||
{
|
{
|
||||||
|
{"\n", "
"},
|
||||||
|
{"\n", "
"},
|
||||||
{" ", " "},
|
{" ", " "},
|
||||||
{"&", "&"},
|
{"&", "&"},
|
||||||
{"<", "<"},
|
{"<", "<"},
|
||||||
|
Reference in New Issue
Block a user