mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
- infoviewer: try to get meta data from stream when epg is empty
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -994,6 +994,51 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
}
|
}
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user