From 341060490e70e1ec82c7fa39df7640a3714efd6f Mon Sep 17 00:00:00 2001 From: Marc Vila Date: Sat, 15 Jun 2019 00:12:26 +0200 Subject: [PATCH] fix web --- script/public/index.js | 2 +- script/radio_script.py | 12 ++++++------ script/tv_script.py | 12 ++++++------ script/utils.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/script/public/index.js b/script/public/index.js index a31f7371..df200593 100644 --- a/script/public/index.js +++ b/script/public/index.js @@ -209,7 +209,7 @@ function loadChannelsInList() { return response.json(); }) .then(function(myJson) { - nacionales = myJson[1]; + nacionales = myJson["countries"][0]; //Spain is the [0] country var items = []; $.each(nacionales["ambits"], function( ambit, ambit_val ) { diff --git a/script/radio_script.py b/script/radio_script.py index 9838bb36..70d90f89 100644 --- a/script/radio_script.py +++ b/script/radio_script.py @@ -148,12 +148,12 @@ andorra.add_ambit(Ambito("Andorra", get_radio_channels_from_part(canales_andorra # Save data to JSON file json_result = {"license": get_license_info(), - "epg_url": None, - "countries": [spain.to_json(), - international.to_json(), - andorra.to_json()], - "updated": get_current_timestamp() - } + "epg_url": None, + "countries": [spain.to_json(), + international.to_json(), + andorra.to_json()], + "updated": get_current_timestamp() + } json_file = open('./public/output/radio_channels.json', "w+") json_file.write(json.dumps(json_result, indent=4, sort_keys=False)) json_file.close() diff --git a/script/tv_script.py b/script/tv_script.py index 66626d59..60e5e930 100755 --- a/script/tv_script.py +++ b/script/tv_script.py @@ -160,12 +160,12 @@ andorra.add_ambit(Ambito("Andorra", get_tv_channels_from_part(canales_andorra))) # Save data to JSON file json_result = {"license": get_license_info(), - "epg_url": "https://raw.githubusercontent.com/HelmerLuzo/TDTChannels_EPG/master/TDTChannels_EPG.xml", - "countries": [spain.to_json(), - international.to_json(), - andorra.to_json()], - "updated": get_current_timestamp() - } + "epg_url": "https://raw.githubusercontent.com/HelmerLuzo/TDTChannels_EPG/master/TDTChannels_EPG.xml", + "countries": [spain.to_json(), + international.to_json(), + andorra.to_json()], + "updated": get_current_timestamp() + } json_file = open('./public/output/channels.json', "w+") json_file.write(json.dumps(json_result, indent=4, sort_keys=False)) json_file.close() diff --git a/script/utils.py b/script/utils.py index 50ff77df..e52aefa5 100755 --- a/script/utils.py +++ b/script/utils.py @@ -1,5 +1,5 @@ -import re import calendar +import re import time from channel import Channel @@ -73,7 +73,7 @@ def get_tv_channels_from_part(text): if "# GEO" in option: more_info = ["GEO"] else: - more_info =[] + more_info = [] channel.add_option(format, url, more_info) channel_list.append(channel) return channel_list