Skip to content
Browse files

pvr: fix duplicate EPG IDs if EPG is not stored in database

  • Loading branch information...
1 parent 185f0a1 commit c3ec74abded0c0c2643ae3d1eb4a53f07ffa06dc @FernetMenta FernetMenta committed Apr 19, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 xbmc/pvr/PVRDatabase.cpp
View
7 xbmc/pvr/PVRDatabase.cpp
@@ -22,6 +22,7 @@
#include "dbwrappers/dataset.h"
#include "settings/AdvancedSettings.h"
#include "settings/VideoSettings.h"
+#include "settings/Settings.h"
#include "utils/log.h"
#include "utils/StringUtils.h"
@@ -292,6 +293,7 @@ int CPVRDatabase::Get(CPVRChannelGroupInternal &results)
{
try
{
+ bool bIgnoreEpgDB = CSettings::Get().GetBool("epg.ignoredbforclient");
while (!m_pDS->eof())
{
CPVRChannelPtr channel = CPVRChannelPtr(new CPVRChannel());
@@ -313,7 +315,10 @@ int CPVRDatabase::Get(CPVRChannelGroupInternal &results)
channel->m_strInputFormat = m_pDS->fv("sInputFormat").get_asString();
channel->m_strStreamURL = m_pDS->fv("sStreamURL").get_asString();
channel->m_iClientEncryptionSystem = m_pDS->fv("iEncryptionSystem").get_asInt();
- channel->m_iEpgId = m_pDS->fv("idEpg").get_asInt();
+ if (bIgnoreEpgDB)
+ channel->m_iEpgId = -1;
+ else
+ channel->m_iEpgId = m_pDS->fv("idEpg").get_asInt();
channel->UpdateEncryptionName();
#if PVRDB_DEBUGGING

0 comments on commit c3ec74a

Please sign in to comment.
Something went wrong with that request. Please try again.