Skip to content

Commit

Permalink
Add possibility for station logos
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasPankner committed Aug 12, 2022
1 parent 001eab0 commit bf6687a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ycast/my_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@


class Station:
def __init__(self, uid, name, url, category):
def __init__(self, uid, name, url, category, icon):
self.id = generic.generate_stationid_with_prefix(uid, ID_PREFIX)
self.name = name
self.url = url
self.tag = category
self.icon = None
self.icon = icon

def to_vtuner(self):
return vtuner.Station(self.id, self.name, self.tag, self.url, self.icon, self.tag, None, None, None, None)
Expand Down Expand Up @@ -70,9 +70,10 @@ def get_stations_by_category(category):
stations = []
if my_stations_yaml and category in my_stations_yaml:
for station_name in my_stations_yaml[category]:
station_url = my_stations_yaml[category][station_name]
station_url = my_stations_yaml[category][station_name]['url']
station_icon = my_stations_yaml[category][station_name]['icon']
station_id = str(get_checksum(station_name + station_url)).upper()
stations.append(Station(station_id, station_name, station_url, category))
stations.append(Station(station_id, station_name, station_url, category, station_icon))
return stations


Expand Down

0 comments on commit bf6687a

Please sign in to comment.