infoviewer: try to get meta data from stream when epg is empty

Origin commit data
------------------
Branch: ni/coolstream
Commit: 9b34075224
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-11-05 (Sun, 05 Nov 2017)

Origin message was:
------------------
- infoviewer: try to get meta data from stream when epg is empty

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-11-05 01:30:16 +01:00
parent 6b91b6a0ad
commit c3415790b1

View File

@@ -1037,6 +1037,51 @@ bool CInfoViewer::showLivestreamInfo()
}
return true;
}
// FIXME: move this block in the block above
else if (web_mode && cc->getEpgID() == 0)
{
// try to get meta data
std::string livestreamInfo1 = "";
std::string livestreamInfo2 = "";
std::string artist = "";
std::string title = "";
std::vector<std::string> keys, values;
cPlayback *playback = CMoviePlayerGui::getInstance().getPlayback();
if (playback)
playback->GetMetadata(keys, values);
size_t count = keys.size();
if (count > 0) {
for (size_t i = 0; i < count; i++) {
std::string key = trim(keys[i]);
if (!strcasecmp("artist", key.c_str())) {
artist = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
continue;
}
if (!strcasecmp("title", key.c_str())) {
title = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
continue;
}
}
}
if (!artist.empty())
{
livestreamInfo1 = artist;
}
if (!title.empty())
{
if (!livestreamInfo1.empty())
livestreamInfo1 += " - ";
livestreamInfo1 += title;
}
if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) {
display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false);
_livestreamInfo1 = livestreamInfo1;
_livestreamInfo2 = livestreamInfo2;
infoViewerBB->showBBButtons(true /*paintFooter*/);
}
return true;
}
return false;
}