2018-02-08 15:40:00 +01:00
|
|
|
import channelInfo
|
2018-02-05 21:44:37 +01:00
|
|
|
from models import *
|
|
|
|
|
|
|
|
for i in [Play, Channel, Song]:
|
|
|
|
i.drop_table()
|
|
|
|
for i in [Channel, Song, Play]:
|
|
|
|
i.create_table()
|
|
|
|
|
2018-02-08 15:40:00 +01:00
|
|
|
for id, channel in channelInfo.channels.items():
|
2019-07-29 18:33:49 +02:00
|
|
|
if "streamurl" in channel:
|
|
|
|
streamurl = "https:" + channel["streamurl"].replace(";", "")
|
2018-02-08 15:40:00 +01:00
|
|
|
else:
|
|
|
|
streamurl = None
|
|
|
|
if "cStationName" in channel:
|
|
|
|
channel["stationname"] = channel["cStationName"]
|
|
|
|
Channel.create(shortname=channel["shortname"], streamurl=streamurl,
|
|
|
|
stationname=channel["stationname"], has_data=channel["cHasData"],
|
|
|
|
primary_color=channel["cPrimaryColor"], secondary_color=channel["cSecondaryColor"])
|