epgview: rework hasFollowScreenings() and FollowScreenings()

the current code has differences in hasFollowScreenings() and
FollowScreenings() leading to different results. hasFollow() returns
true but Follow() then notices that there are actually no repeats.
Fix this by making hasFollowScreenings() generate a list "followlist"
containing all repeats and FollowScreenings() use that list.
An added benefit is that the requested feature to add a possibility to
select one of the follow-ups for a record timer will be also able to
use that list ;-)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1383 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 90164158b3
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-04-10 (Sun, 10 Apr 2011)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2011-04-10 18:10:25 +00:00
parent f02fec6579
commit 5ede60c563
2 changed files with 31 additions and 31 deletions

View File

@@ -420,17 +420,6 @@ const neutrino_locale_t * genre_sub_classes_list[10] =
genre_travel_hobbies
};
bool CEpgData::hasFollowScreenings(const t_channel_id /*channel_id*/, const std::string & title) {
time_t curtime = time(NULL);
for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e )
{
if (e->startTime > curtime && e->eventID && e->description == title)
return true;
}
return false;
}
const char * GetGenre(const unsigned char contentClassification) // UTF-8
{
neutrino_locale_t res;
@@ -1070,8 +1059,24 @@ void CEpgData::GetPrevNextEPGData( uint64_t id, time_t* startzeit )
// -- 2002-05-03 rasc
//
int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::string & title)
bool CEpgData::hasFollowScreenings(const t_channel_id /*channel_id*/, const std::string &title)
{
CChannelEventList::iterator e;
followlist.clear();
for (e = evtlist.begin(); e != evtlist.end(); ++e)
{
if (e->startTime <= tmp_curent_zeit)
continue;
if (! e->eventID)
continue;
if (e->description != title)
continue;
followlist.push_back(*e);
}
return !followlist.empty();
}
int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::string & title)
{
CChannelEventList::iterator e;
struct tm *tmStartZeit;
@@ -1082,32 +1087,26 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st
screening_dates = screening_nodual = "";
// alredy read: evtlist = g_Sectionsd->getEventsServiceKey( channel_id&0xFFFFFFFFFFFFULL );
for ( e= evtlist.begin(); e != evtlist.end(); ++e )
for (e = followlist.begin(); e != followlist.end(); ++e)
{
if (e->startTime <= tmp_curent_zeit) continue;
if (! e->eventID) continue;
if (e->description == title) {
count++;
tmStartZeit = localtime(&(e->startTime));
count++;
tmStartZeit = localtime(&(e->startTime));
screening_dates = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit));
screening_dates += '.';
screening_dates = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit));
screening_dates += '.';
strftime(tmpstr, sizeof(tmpstr), " %d.", tmStartZeit );
screening_dates += tmpstr;
strftime(tmpstr, sizeof(tmpstr), " %d.", tmStartZeit );
screening_dates += tmpstr;
screening_dates += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit));
screening_dates += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit));
strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit );
screening_dates += tmpstr;
if (screening_dates != screening_nodual) {
screening_nodual=screening_dates;
processTextToArray(screening_dates, true ); // UTF-8
}
strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit );
screening_dates += tmpstr;
if (screening_dates != screening_nodual) {
screening_nodual=screening_dates;
processTextToArray(screening_dates, true ); // UTF-8
}
}
if (count == 0)
processTextToArray("---\n"); // UTF-8
return count;
}