diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index c60ceff0..01ab8280 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1260,6 +1260,16 @@ GeoLite2 Database last updated never.

+
+ +
+
+ +
+ +
+

The interval (in days) Tautulli will automatically update the GeoLite2 database. Minimum 7, default 30.

+

diff --git a/plexpy/config.py b/plexpy/config.py index 104e3553..58e57f2e 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -176,6 +176,7 @@ _CONFIG_DEFINITIONS = { 'FREEZE_DB': (int, 'General', 0), 'GEOIP_DB': (str, 'General', ''), 'GEOIP_DB_INSTALLED': (int, 'General', 0), + 'GEOIP_DB_UPDATE_DAYS': (int, 'General', 30), 'GET_FILE_SIZES': (int, 'General', 0), 'GET_FILE_SIZES_HOLD': (dict, 'General', {'section_ids': [], 'rating_keys': []}), 'GIT_BRANCH': (str, 'General', 'master'), diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 099be9c4..6597b12e 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -588,7 +588,7 @@ def update_geoip_db(): if plexpy.CONFIG.GEOIP_DB_INSTALLED > 1: logger.info(u"Tautulli Helpers :: Checking for GeoLite2 database updates.") now = int(time.time()) - if now - plexpy.CONFIG.GEOIP_DB_INSTALLED >= 2592000: # 30 days + if now - plexpy.CONFIG.GEOIP_DB_INSTALLED >= plexpy.CONFIG.GEOIP_DB_UPDATE_DAYS * 24 * 60 * 60: return install_geoip_db(update=True) logger.info(u"Tautulli Helpers :: GeoLite2 database already updated within the last 30 days.") diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 427b1025..7c82ef21 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2820,9 +2820,10 @@ class WebInterface(object): "newsletter_inline_styles": checked(plexpy.CONFIG.NEWSLETTER_INLINE_STYLES), "newsletter_custom_dir": plexpy.CONFIG.NEWSLETTER_CUSTOM_DIR, "win_sys_tray": checked(plexpy.CONFIG.WIN_SYS_TRAY), + "maxmind_license_key": plexpy.CONFIG.MAXMIND_LICENSE_KEY, "geoip_db": plexpy.CONFIG.GEOIP_DB, "geoip_db_installed": plexpy.CONFIG.GEOIP_DB_INSTALLED, - "maxmind_license_key": plexpy.CONFIG.MAXMIND_LICENSE_KEY + "geoip_db_update_days": plexpy.CONFIG.GEOIP_DB_UPDATE_DAYS } return serve_template(templatename="settings.html", title="Settings", config=config, kwargs=kwargs)