* Commit 295efb1: Fix delete query when multiple same channelid

This commit is contained in:
micha-bbg
2012-10-24 11:46:22 +02:00
parent ec48d24af2
commit 8681a9c399
3 changed files with 30 additions and 12 deletions

View File

@@ -1096,6 +1096,18 @@ bool CRecordManager::Stop(const t_channel_id channel_id)
return (inst != NULL); return (inst != NULL);
} }
bool CRecordManager::IsRecording(const CTimerd::RecordingStopInfo * recinfo)
{
bool ret = false;
mutex.lock();
CRecordInstance * inst = FindInstanceID(recinfo->eventID);
if(inst != NULL && recinfo->eventID == inst->GetRecordingId())
ret = true;
mutex.unlock();
printf("[%s] eventID: %d, channel_id: 0x%llx, ret: %d\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id, ret);
return ret;
}
bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo) bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo)
{ {
bool ret = false; bool ret = false;

View File

@@ -187,6 +187,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
bool Record(const t_channel_id channel_id, const char * dir = NULL, bool timeshift = false); bool Record(const t_channel_id channel_id, const char * dir = NULL, bool timeshift = false);
bool Stop(const t_channel_id channel_id); bool Stop(const t_channel_id channel_id);
bool Stop(const CTimerd::RecordingStopInfo * recinfo); bool Stop(const CTimerd::RecordingStopInfo * recinfo);
bool IsRecording(const CTimerd::RecordingStopInfo * recinfo);
bool Update(const t_channel_id channel_id); bool Update(const t_channel_id channel_id);
bool ShowMenu(void); bool ShowMenu(void);
bool AskToStop(const t_channel_id channel_id, const int recid = 0); bool AskToStop(const t_channel_id channel_id, const int recid = 0);

View File

@@ -574,18 +574,23 @@ int CTimerList::show()
{ {
bool killTimer = true; bool killTimer = true;
if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) { if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) {
std::string title = ""; CTimerd::RecordingStopInfo recinfo;
char buf1[1024]; recinfo.channel_id = timerlist[selected].channel_id;
CEPGData epgdata; recinfo.eventID = timerlist[selected].eventID;
CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata); if (CRecordManager::getInstance()->IsRecording(&recinfo)) {
memset(buf1, '\0', sizeof(buf1)); std::string title = "";
if (epgdata.title != "") char buf1[1024];
title = "(" + epgdata.title + ")\n"; CEPGData epgdata;
snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata);
if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, memset(buf1, '\0', sizeof(buf1));
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { if (epgdata.title != "")
killTimer = false; title = "(" + epgdata.title + ")\n";
update = false; snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str());
if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1,
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) {
killTimer = false;
update = false;
}
} }
} }
if (killTimer) { if (killTimer) {