aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2017-08-29 16:05:08 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2017-08-29 22:00:10 +0200
commit2db0e7a7c5bc1331a7909963570c50ad5ae3d7a4 (patch)
tree715d1aacb32791f70bfec778bf3c9ae9b739abb8
parentba1cfe9fbd88bd0596851f7cd5f14d5e0ca7be8e (diff)
[PVR][settings] Make epg.lingertime an official setting, remove the respective advanced setting.
-rw-r--r--addons/resource.language.en_gb/resources/strings.po17
-rwxr-xr-xsystem/settings/settings.xml14
-rw-r--r--xbmc/addons/PVRClient.cpp2
-rw-r--r--xbmc/pvr/PVRActionListener.cpp4
-rw-r--r--xbmc/pvr/epg/Epg.cpp7
-rw-r--r--xbmc/pvr/epg/EpgContainer.cpp20
-rw-r--r--xbmc/pvr/windows/GUIEPGGridContainerModel.cpp9
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp4
-rw-r--r--xbmc/settings/AdvancedSettings.cpp2
-rw-r--r--xbmc/settings/AdvancedSettings.h1
-rw-r--r--xbmc/settings/Settings.cpp3
-rw-r--r--xbmc/settings/Settings.h3
12 files changed, 54 insertions, 32 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index efce1338cf..fbb919689b 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -10064,10 +10064,10 @@ msgctxt "#19181"
msgid "Menu / OSD"
msgstr ""
-#. pvr settings "epg days to display" setting value
+#. pvr settings "future epg days to display" setting value
#: system/settings/settings.xml
msgctxt "#19182"
-msgid "Days to display"
+msgid "Future days to display"
msgstr ""
#. Settings -> Interface -> Other -> Startup window value
@@ -10339,7 +10339,11 @@ msgctxt "#19228"
msgid "Timer deleted"
msgstr ""
-#empty string with id 19229
+#. pvr settings "past epg days to display" setting value
+#: system/settings/settings.xml
+msgctxt "#19229"
+msgid "Past days to display"
+msgstr ""
#. label for PVR settings no epg updates during playback control
#: system/settings/settings.xml
@@ -18090,11 +18094,14 @@ msgctxt "#36218"
msgid "This category contains the electronic programming guide (EPG) settings."
msgstr ""
-#empty string with id 36219
+#: system/settings/settings.xml
+msgctxt "#36219"
+msgid "Number of past days to show in the guide and to import from backends."
+msgstr ""
#: system/settings/settings.xml
msgctxt "#36220"
-msgid "Number of days to show in the guide and import data for from backends."
+msgid "Number of future days to show in the guide and to import from backends."
msgstr ""
#: system/settings/settings.xml
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index e9e362a052..763ab04833 100755
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -1308,7 +1308,19 @@
</category>
<category id="epg" label="22020" help="36218">
<group id="1" label="128">
- <setting id="epg.daystodisplay" type="integer" label="19182" help="36220">
+ <setting id="epg.pastdaystodisplay" type="integer" label="19229" help="36219">
+ <level>2</level>
+ <default>1</default>
+ <constraints>
+ <minimum>0</minimum>
+ <step>1</step>
+ <maximum>31</maximum>
+ </constraints>
+ <control type="spinner" format="string">
+ <formatlabel>17999</formatlabel>
+ </control>
+ </setting>
+ <setting id="epg.futuredaystodisplay" type="integer" label="19182" help="36220">
<level>2</level>
<default>3</default>
<constraints>
diff --git a/xbmc/addons/PVRClient.cpp b/xbmc/addons/PVRClient.cpp
index cc546ddf89..88a114d46f 100644
--- a/xbmc/addons/PVRClient.cpp
+++ b/xbmc/addons/PVRClient.cpp
@@ -150,7 +150,7 @@ void CPVRClient::ResetProperties(int iClientId /* = PVR_INVALID_CLIENT_ID */)
m_struct = {{0}};
m_struct.props.strUserPath = m_strUserPath.c_str();
m_struct.props.strClientPath = m_strClientPath.c_str();
- m_struct.props.iEpgMaxDays = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_DAYSTODISPLAY);
+ m_struct.props.iEpgMaxDays = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY);
m_struct.toKodi.kodiInstance = this;
m_struct.toKodi.TransferEpgEntry = cb_transfer_epg_entry;
diff --git a/xbmc/pvr/PVRActionListener.cpp b/xbmc/pvr/PVRActionListener.cpp
index a8b7ab686a..0159bf360b 100644
--- a/xbmc/pvr/PVRActionListener.cpp
+++ b/xbmc/pvr/PVRActionListener.cpp
@@ -48,7 +48,7 @@ CPVRActionListener::CPVRActionListener()
CSettings::SETTING_PVRMANAGER_CHANNELSCAN,
CSettings::SETTING_PVRMENU_SEARCHICONS,
CSettings::SETTING_PVRCLIENT_MENUHOOK,
- CSettings::SETTING_EPG_DAYSTODISPLAY
+ CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY
});
}
@@ -203,7 +203,7 @@ void CPVRActionListener::OnSettingChanged(std::shared_ptr<const CSetting> settin
std::static_pointer_cast<CSettingBool>(std::const_pointer_cast<CSetting>(setting))->SetValue(false);
}
}
- else if (settingId == CSettings::SETTING_EPG_DAYSTODISPLAY)
+ else if (settingId == CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY)
{
CServiceBroker::GetPVRManager().Clients()->SetEPGTimeFrame(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
}
diff --git a/xbmc/pvr/epg/Epg.cpp b/xbmc/pvr/epg/Epg.cpp
index d9df8c8bdc..ea8dbb6d1b 100644
--- a/xbmc/pvr/epg/Epg.cpp
+++ b/xbmc/pvr/epg/Epg.cpp
@@ -145,8 +145,8 @@ void CPVREpg::Clear(void)
void CPVREpg::Cleanup(void)
{
- CDateTime cleanupTime = CDateTime::GetCurrentDateTime().GetAsUTCDateTime() -
- CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0);
+ int iPastDays = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY);
+ const CDateTime cleanupTime = CDateTime::GetUTCDateTime() - CDateTimeSpan(iPastDays, 0, 0, 0);
Cleanup(cleanupTime);
}
@@ -477,7 +477,8 @@ bool CPVREpg::UpdateEntry(const CPVREpgInfoTagPtr &tag, EPG_EVENT_STATE newState
else
{
// Respect epg linger time.
- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0));
+ int iPastDays = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY);
+ const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(iPastDays, 0, 0, 0));
if (it->second->EndAsUTC() < cleanupTime)
{
if (bUpdateDatabase)
diff --git a/xbmc/pvr/epg/EpgContainer.cpp b/xbmc/pvr/epg/EpgContainer.cpp
index 97102a09ed..3cceb13602 100644
--- a/xbmc/pvr/epg/EpgContainer.cpp
+++ b/xbmc/pvr/epg/EpgContainer.cpp
@@ -118,7 +118,9 @@ CPVREpgContainer::CPVREpgContainer(void) :
m_settings({
CSettings::SETTING_EPG_IGNOREDBFORCLIENT,
CSettings::SETTING_EPG_EPGUPDATE,
- CSettings::SETTING_EPG_DAYSTODISPLAY
+ CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY,
+ CSettings::SETTING_EPG_PAST_DAYSTODISPLAY,
+ CSettings::SETTING_EPG_PREVENTUPDATESWHILEPLAYINGTV
})
{
m_progressHandle = NULL;
@@ -323,8 +325,8 @@ void CPVREpgContainer::LoadFromDB(void)
ShowProgressDialog(false);
}
- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() -
- CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0));
+ int iPastDays = m_settings.GetIntValue(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY);
+ const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(iPastDays, 0, 0, 0));
m_database.DeleteEpgEntries(cleanupTime);
m_database.Get(*this);
@@ -592,8 +594,8 @@ CPVREpgPtr CPVREpgContainer::CreateChannelEpg(const CPVRChannelPtr &channel)
bool CPVREpgContainer::RemoveOldEntries(void)
{
- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() -
- CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0));
+ int iPastDays = m_settings.GetIntValue(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY);
+ const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(iPastDays, 0, 0, 0));
/* call Cleanup() on all known EPG tables */
for (const auto &epgEntry : m_epgs)
@@ -673,7 +675,7 @@ bool CPVREpgContainer::InterruptUpdate(void) const
bReturn = g_application.m_bStop || m_bStop || m_bPreventUpdates;
return bReturn ||
- (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_EPG_PREVENTUPDATESWHILEPLAYINGTV) &&
+ (m_settings.GetBoolValue(CSettings::SETTING_EPG_PREVENTUPDATESWHILEPLAYINGTV) &&
g_application.m_pPlayer && g_application.m_pPlayer->IsPlaying());
}
@@ -703,9 +705,9 @@ bool CPVREpgContainer::UpdateEPG(bool bOnlyPending /* = false */)
/* set start and end time */
time_t start;
time_t end;
- CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(start);
- end = start + m_settings.GetIntValue(CSettings::SETTING_EPG_DAYSTODISPLAY) * 24 * 60 * 60;
- start -= g_advancedSettings.m_iEpgLingerTime * 60;
+ CDateTime::GetUTCDateTime().GetAsTime(start);
+ end = start + m_settings.GetIntValue(CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY) * 24 * 60 * 60;
+ start -= m_settings.GetIntValue(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY) * 24 * 60 * 60;
bShowProgress = g_advancedSettings.m_bEpgDisplayUpdatePopup && (m_bIsInitialising || g_advancedSettings.m_bEpgDisplayIncrementalUpdatePopup);
{
diff --git a/xbmc/pvr/windows/GUIEPGGridContainerModel.cpp b/xbmc/pvr/windows/GUIEPGGridContainerModel.cpp
index 30d3f4ad97..62858f2522 100644
--- a/xbmc/pvr/windows/GUIEPGGridContainerModel.cpp
+++ b/xbmc/pvr/windows/GUIEPGGridContainerModel.cpp
@@ -23,7 +23,8 @@
#include <cmath>
#include "FileItem.h"
-#include "settings/AdvancedSettings.h"
+#include "ServiceBroker.h"
+#include "settings/Settings.h"
#include "utils/Variant.h"
#include "pvr/channels/PVRChannel.h"
@@ -325,10 +326,10 @@ void CGUIEPGGridContainerModel::FindChannelAndBlockIndex(int channelUid, unsigne
unsigned int CGUIEPGGridContainerModel::GetGridStartPadding() const
{
- unsigned int iEpgLingerTime = g_advancedSettings.m_iEpgLingerTime;
+ unsigned int iPastMinutes = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY) * 24 * 60;
- if (iEpgLingerTime < GRID_START_PADDING)
- return iEpgLingerTime;
+ if (iPastMinutes < GRID_START_PADDING)
+ return iPastMinutes;
return GRID_START_PADDING; // minutes
}
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index a2811867b9..b777d32fa4 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -26,7 +26,6 @@
#include "dialogs/GUIDialogBusy.h"
#include "input/Key.h"
#include "messaging/ApplicationMessenger.h"
-#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "threads/SingleLock.h"
#include "utils/log.h"
@@ -496,7 +495,8 @@ bool CGUIWindowPVRGuideBase::RefreshTimelineItems()
endDate = startDate;
// limit start to linger time
- const CDateTime maxPastDate(currentDate - CDateTimeSpan(0, 0, g_advancedSettings.m_iEpgLingerTime, 0));
+ int iPastDays = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_PAST_DAYSTODISPLAY);
+ const CDateTime maxPastDate(currentDate - CDateTimeSpan(iPastDays, 0, 0, 0));
if (startDate < maxPastDate)
startDate = maxPastDate;
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 07fed4c41f..1206f1838c 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -300,7 +300,6 @@ void CAdvancedSettings::Initialize()
m_bVideoScannerIgnoreErrors = false;
m_iVideoLibraryDateAdded = 1; // prefer mtime over ctime and current time
- m_iEpgLingerTime = 60 * 24; /* keep 24 hours by default */
m_iEpgUpdateCheckInterval = 300; /* check if tables need to be updated every 5 minutes */
m_iEpgCleanupInterval = 900; /* remove old entries from the EPG every 15 minutes */
m_iEpgActiveTagCheckInterval = 60; /* check for updated active tags every minute */
@@ -881,7 +880,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
pElement = pRootElement->FirstChildElement("epg");
if (pElement)
{
- XMLUtils::GetInt(pElement, "lingertime", m_iEpgLingerTime);
XMLUtils::GetInt(pElement, "updatecheckinterval", m_iEpgUpdateCheckInterval);
XMLUtils::GetInt(pElement, "cleanupinterval", m_iEpgCleanupInterval);
XMLUtils::GetInt(pElement, "activetagcheckinterval", m_iEpgActiveTagCheckInterval);
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
index e84b2317b5..bf1c9b8c10 100644
--- a/xbmc/settings/AdvancedSettings.h
+++ b/xbmc/settings/AdvancedSettings.h
@@ -279,7 +279,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
std::set<std::string> m_vecTokens;
- int m_iEpgLingerTime; // minutes
int m_iEpgUpdateCheckInterval; // seconds
int m_iEpgCleanupInterval; // seconds
int m_iEpgActiveTagCheckInterval; // seconds
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index 32461c5ab8..f09e5ceffc 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -227,7 +227,8 @@ const std::string CSettings::SETTING_PVRMANAGER_RESETDB = "pvrmanager.resetdb";
const std::string CSettings::SETTING_PVRMENU_DISPLAYCHANNELINFO = "pvrmenu.displaychannelinfo";
const std::string CSettings::SETTING_PVRMENU_ICONPATH = "pvrmenu.iconpath";
const std::string CSettings::SETTING_PVRMENU_SEARCHICONS = "pvrmenu.searchicons";
-const std::string CSettings::SETTING_EPG_DAYSTODISPLAY = "epg.daystodisplay";
+const std::string CSettings::SETTING_EPG_PAST_DAYSTODISPLAY = "epg.pastdaystodisplay";
+const std::string CSettings::SETTING_EPG_FUTURE_DAYSTODISPLAY = "epg.futuredaystodisplay";
const std::string CSettings::SETTING_EPG_SELECTACTION = "epg.selectaction";
const std::string CSettings::SETTING_EPG_HIDENOINFOAVAILABLE = "epg.hidenoinfoavailable";
const std::string CSettings::SETTING_EPG_EPGUPDATE = "epg.epgupdate";
diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h
index 41a6d94efc..9140fa39f0 100644
--- a/xbmc/settings/Settings.h
+++ b/xbmc/settings/Settings.h
@@ -173,7 +173,8 @@ public:
static const std::string SETTING_PVRMENU_DISPLAYCHANNELINFO;
static const std::string SETTING_PVRMENU_ICONPATH;
static const std::string SETTING_PVRMENU_SEARCHICONS;
- static const std::string SETTING_EPG_DAYSTODISPLAY;
+ static const std::string SETTING_EPG_PAST_DAYSTODISPLAY;
+ static const std::string SETTING_EPG_FUTURE_DAYSTODISPLAY;
static const std::string SETTING_EPG_SELECTACTION;
static const std::string SETTING_EPG_HIDENOINFOAVAILABLE;
static const std::string SETTING_EPG_EPGUPDATE;