diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index fd50522a..7ca4b323 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1242,7 +1242,7 @@

- Enter and save your MaxMind License Key to install the GeoLite2 database. + Enter your MaxMind License Key to install the GeoLite2 database.

@@ -1250,13 +1250,14 @@
- + - +
+

GeoLite2 Database last updated never. @@ -1999,7 +2000,6 @@ $(document).ready(function() { getNewslettersTable(); getMobileDevicesTable(); loadUpdateDistros(); - enableGeoLiteInstallButton(); settingsChanged = false; } @@ -2863,20 +2863,22 @@ $(document).ready(function() { gotoSetting('3rd_party_apis', 'geoip_db') } - function enableGeoLiteInstallButton() { - $('#install_geoip_db').prop('disabled', !(Boolean($("#maxmind_license_key").val()))); - } - enableGeoLiteInstallButton(); - if ("${config['geoip_db_installed']}" > "0") { $("#geoip_db_updated").text(moment("${config['geoip_db_installed']}", "X").fromNow()); } $("#install_geoip_db").click(function () { + if ($.trim($("#maxmind_license_key").val()) === "") { + $("#maxmind_license_key").focus(); + showMsg(' Maxmind License Key cannot be blank.', false, true, 5000, true); + return false; + } else if (!(saveSettings())){ + return false; + } var msg = 'Are you sure you want to install the GeoLite2 database?

' + 'The database is used to lookup IP address geolocation info.
' + 'The database will be downloaded from MaxMind,
' + - 'and requires 100MB of free space to install in your Tautulli directory.
'; + 'and requires 100MB of free space to install.
'; var url = 'install_geoip_db'; if ($(this).text() === 'Update') { url += '?update=true'; diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 630f6e4d..bc12a773 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -609,6 +609,10 @@ def install_geoip_db(update=False): geolite2_db = maxmind_db + '.mmdb' geolite2_db_path = plexpy.CONFIG.GEOIP_DB or os.path.join(plexpy.DATA_DIR, geolite2_db) + # Check path ends with .mmdb + if os.path.splitext(geolite2_db_path)[1] != os.path.splitext(geolite2_db)[1]: + geolite2_db_path = os.path.join(geolite2_db_path, geolite2_db) + temp_gz = os.path.join(plexpy.CONFIG.CACHE_DIR, geolite2_gz) temp_md5 = os.path.join(plexpy.CONFIG.CACHE_DIR, geolite2_md5)