From bf6687ab9b5779a2f2f7c5b8bf5627c21df4d16d Mon Sep 17 00:00:00 2001 From: Tobias Pankner Date: Fri, 12 Aug 2022 19:49:55 +0200 Subject: [PATCH] Add possibility for station logos --- ycast/my_stations.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ycast/my_stations.py b/ycast/my_stations.py index 64df667..9a69ed3 100644 --- a/ycast/my_stations.py +++ b/ycast/my_stations.py @@ -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) @@ -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