1
0
Fork 0
mirror of https://github.com/LaQuay/TDTChannels.git synced 2024-11-01 15:04:16 +01:00

Send nulls instead of empty string to avoid stings logic

This commit is contained in:
Jacobo Rodriguez 2019-06-14 06:43:51 +02:00
parent c2c599133d
commit f088ceddd5

View file

@ -41,7 +41,7 @@ def get_tv_channels_from_part(text):
if len(item_web) > 0 and item_web[0] != "-":
item_web = stringbetweenparantheses(item_web)
if len(item_web) == 1:
item_web = ""
item_web = None
if "HD" in item_name:
item_resolution = "HD"
@ -52,11 +52,11 @@ def get_tv_channels_from_part(text):
if len(item_logo) > 0 and item_logo[0] != "-":
item_logo = stringbetweenparantheses(item_logo)
if len(item_logo) == 1:
item_logo = ""
item_logo = None
item_epg = list_to_iterate[i + 4].strip()
if len(item_epg) == 1:
item_epg = ""
item_epg = None
item_extra_info = list_to_iterate[i + 5].strip()
if len(item_extra_info) == 1:
@ -95,13 +95,13 @@ def get_radio_channels_from_part(text):
if len(item_web) > 0 and item_web[0] != "-":
item_web = stringbetweenparantheses(item_web)
if len(item_web) == 1:
item_web = ""
item_web = None
item_logo = list_to_iterate[i + 3].strip()
if len(item_logo) > 0 and item_logo[0] != "-":
item_logo = stringbetweenparantheses(item_logo)
if len(item_logo) == 1:
item_logo = ""
item_logo = None
item_extra_info = list_to_iterate[i + 4].strip()
if len(item_extra_info) == 1:
@ -109,7 +109,7 @@ def get_radio_channels_from_part(text):
else:
item_extra_info = item_extra_info.split(",")
channel = Channel(item_name, item_web, "", item_logo, "", item_extra_info)
channel = Channel(item_name, item_web, None, item_logo, None, item_extra_info)
item_options = item_options.split(" - ")
if len(item_options) > 0 and item_options[0] != "-":
for option in item_options: