mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
movieplayer: more readability in code to search for livestream script
Origin commit data
------------------
Branch: ni/coolstream
Commit: 9855748197
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-09-27 (Thu, 27 Sep 2018)
Origin message was:
------------------
- movieplayer: more readability in code to search for livestream script
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1113,22 +1113,42 @@ bool CMoviePlayerGui::getLiveUrl(const std::string &url, const std::string &scri
|
|||||||
|
|
||||||
if (_script.find("/") == std::string::npos)
|
if (_script.find("/") == std::string::npos)
|
||||||
{
|
{
|
||||||
bool webradio = (m_ThisMode == NeutrinoModes::mode_webradio);
|
std::list<std::string> paths;
|
||||||
|
// try livestreamScript from user's livestreamScriptPath
|
||||||
std::string _s = g_settings.livestreamScriptPath + "/" + _script;
|
paths.push_back(g_settings.livestreamScriptPath);
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
|
||||||
// try livestreamScripts from webradio/webtv autoload directories
|
// try livestreamScripts from webradio/webtv autoload directories
|
||||||
if (!file_exists(_s.c_str()))
|
if (m_ThisMode == NeutrinoModes::mode_webradio)
|
||||||
{
|
{
|
||||||
_s = std::string(webradio ? WEBRADIODIR_VAR : WEBTVDIR_VAR) + "/" + _script;
|
paths.push_back(WEBRADIODIR_VAR);
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
paths.push_back(WEBRADIODIR);
|
||||||
}
|
}
|
||||||
if (!file_exists(_s.c_str()))
|
else
|
||||||
{
|
{
|
||||||
_s = std::string(webradio ? WEBRADIODIR : WEBTVDIR) + "/" + _script;
|
paths.push_back(WEBTVDIR_VAR);
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
paths.push_back(WEBTVDIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string _s;
|
||||||
|
_s.clear();
|
||||||
|
|
||||||
|
for (std::list<std::string>::iterator it = paths.begin(); it != paths.end(); ++it)
|
||||||
|
{
|
||||||
|
_s = *it + "/" + _script;
|
||||||
|
if (file_exists(_s.c_str()))
|
||||||
|
break;
|
||||||
|
_s.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_s.empty())
|
||||||
|
{
|
||||||
_script = _s;
|
_script = _s;
|
||||||
|
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _script.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(">>>>> [%s:%s:%d] script not found: %s\n", __file__, __func__, __LINE__, _script.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
size_t pos = _script.find(".lua");
|
size_t pos = _script.find(".lua");
|
||||||
if (!file_exists(_script.c_str()) || (pos == std::string::npos) || (_script.length()-pos != 4)) {
|
if (!file_exists(_script.c_str()) || (pos == std::string::npos) || (_script.length()-pos != 4)) {
|
||||||
|
Reference in New Issue
Block a user