mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
Add continent to geoip lookup
This commit is contained in:
parent
b9b844dd38
commit
b905e0139c
3 changed files with 15 additions and 12 deletions
|
@ -40,6 +40,7 @@
|
||||||
<div id="ip_error" class="col-sm-12 text-muted"></div>
|
<div id="ip_error" class="col-sm-12 text-muted"></div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
|
<li>Continent: <strong><span id="continent"></span></strong></li>
|
||||||
<li>Country: <strong><span id="country"></span></strong></li>
|
<li>Country: <strong><span id="country"></span></strong></li>
|
||||||
<li>Region: <strong><span id="region"></span></strong></li>
|
<li>Region: <strong><span id="region"></span></strong></li>
|
||||||
<li>City: <strong><span id="city"></span></strong></li>
|
<li>City: <strong><span id="city"></span></strong></li>
|
||||||
|
@ -103,6 +104,7 @@
|
||||||
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> ' + result.message).show();
|
$('#ip_error').html('<i class="fa fa-exclamation-circle"></i> ' + result.message).show();
|
||||||
} else {
|
} else {
|
||||||
var data = result.data;
|
var data = result.data;
|
||||||
|
$('#continent').html(data.continent);
|
||||||
$('#country').html(data.country);
|
$('#country').html(data.country);
|
||||||
$('#region').html(data.region);
|
$('#region').html(data.region);
|
||||||
$('#city').html(data.city);
|
$('#city').html(data.city);
|
||||||
|
|
|
@ -930,15 +930,15 @@ class PlexTV(object):
|
||||||
if len(coordinates) == 2:
|
if len(coordinates) == 2:
|
||||||
latitude, longitude = [helpers.cast_to_float(c) for c in coordinates]
|
latitude, longitude = [helpers.cast_to_float(c) for c in coordinates]
|
||||||
|
|
||||||
geo_info = {"code": helpers.get_xml_attr(a, 'code') or None,
|
geo_info = {"city": helpers.get_xml_attr(a, 'city') or None,
|
||||||
|
"code": helpers.get_xml_attr(a, 'code') or None,
|
||||||
|
"continent": helpers.get_xml_attr(a, 'continent_code') or None,
|
||||||
"country": helpers.get_xml_attr(a, 'country') or None,
|
"country": helpers.get_xml_attr(a, 'country') or None,
|
||||||
"region": helpers.get_xml_attr(a, 'subdivisions') or None,
|
|
||||||
"city": helpers.get_xml_attr(a, 'city') or None,
|
|
||||||
"postal_code": helpers.get_xml_attr(a, 'postal_code') or None,
|
|
||||||
"timezone": helpers.get_xml_attr(a, 'time_zone') or None,
|
|
||||||
"latitude": latitude,
|
"latitude": latitude,
|
||||||
"longitude": longitude,
|
"longitude": longitude,
|
||||||
"continent": None, # keep for backwards compatibility with GeoLite2
|
"postal_code": helpers.get_xml_attr(a, 'postal_code') or None,
|
||||||
|
"region": helpers.get_xml_attr(a, 'subdivisions') or None,
|
||||||
|
"timezone": helpers.get_xml_attr(a, 'time_zone') or None,
|
||||||
"accuracy": None # keep for backwards compatibility with GeoLite2
|
"accuracy": None # keep for backwards compatibility with GeoLite2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6402,15 +6402,16 @@ class WebInterface(object):
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
json:
|
json:
|
||||||
{"code": 'US",
|
{"city": "Mountain View",
|
||||||
|
"code": "US",
|
||||||
|
"continent": "NA",
|
||||||
"country": "United States",
|
"country": "United States",
|
||||||
"region": "California",
|
|
||||||
"city": "Mountain View",
|
|
||||||
"postal_code": "94035",
|
|
||||||
"timezone": "America/Los_Angeles",
|
|
||||||
"latitude": 37.386,
|
"latitude": 37.386,
|
||||||
"longitude": -122.0838,
|
"longitude": -122.0838,
|
||||||
"accuracy": 1000
|
"postal_code": "94035",
|
||||||
|
"region": "California",
|
||||||
|
"timezone": "America/Los_Angeles",
|
||||||
|
"accuracy": null
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue