diff --git a/server.py b/server.py index f13ab18..d4f5c78 100644 --- a/server.py +++ b/server.py @@ -264,5 +264,6 @@ class SlideshowHandler(http.server.SimpleHTTPRequestHandler): if __name__ == "__main__": os.chdir(os.path.dirname(os.path.abspath(__file__))) print(f"Serving slideshow on http://0.0.0.0:{cfg['PORT']}") + socketserver.TCPServer.allow_reuse_address = True with socketserver.TCPServer(("", cfg['PORT']), SlideshowHandler) as httpd: httpd.serve_forever() diff --git a/show.html b/show.html index db0a523..b838165 100644 --- a/show.html +++ b/show.html @@ -181,14 +181,20 @@ day: 'numeric' }); if (typeof data.geo_data == 'undefined' || data.geo_data == null) { - document.getElementById('photo-GeoData').textContent = "" + document.getElementById('photo-GeoData').textContent = "" }else if(typeof data.geo_data.GeoData.features[0].properties.name !== 'undefined' & data.geo_data.GeoData.features[0].properties.name !== null & data.geo_data.GeoData.features[0].properties.name !== 'undefined' ){ document.getElementById('photo-GeoData').textContent = data.geo_data.GeoData.features[0].properties.name + " - " + data.geo_data.GeoData.features[0].properties.city+ ", " + data.geo_data.GeoData.features[0].properties.country; }else{ - document.getElementById('photo-GeoData').textContent = data.geo_data.GeoData.features[0].properties.city+ ", " + data.geo_data.GeoData.features[0].properties.country; + document.getElementById('photo-GeoData').textContent = data.geo_data.GeoData.features[0].properties.city+ ", " + data.geo_data.GeoData.features[0].properties.country; } - document.getElementById('photo-Date').textContent = formatted; + if((typeof data.capture_date == 'undefined' || data.capture_date == null) && (typeof data.geo_data == 'undefined' || data.geo_data == null)){ + document.getElementById('photo-Date').textContent = "Not available" + }else if (typeof data.capture_date == 'undefined' || data.capture_date == null) { + document.getElementById('photo-Date').textContent = "" + }else{ + document.getElementById('photo-Date').textContent = formatted; + } } // --- Clock ---