This commit is contained in:
Canuma 2021-11-25 23:26:33 +01:00 committed by GitHub
commit 948c5c9344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -155,3 +155,11 @@ def get_stations_by_votes(limit=DEFAULT_STATION_LIMIT):
if SHOW_BROKEN_STATIONS or get_json_attr(station_json, 'lastcheckok') == 1:
stations.append(Station(station_json))
return stations
def click_vote(uid):
clickvote_json = request('url/' + str(uid))
if clickvote_json:
logging.debug("radio-browser replied: %s", get_json_attr(clickvote_json, 'message'))
else:
logging.error('clickvote did not work')

View file

@ -24,6 +24,7 @@ PATH_RADIOBROWSER_POPULAR = 'popular'
station_tracking = False
my_stations_enabled = False
enable_clickvote = False
app = Flask(__name__)
@ -282,6 +283,8 @@ def get_station_info():
if station_tracking:
vtuner_station.set_trackurl(request.host_url + PATH_ROOT + '/' + PATH_PLAY + '?id=' + vtuner_station.uid)
vtuner_station.icon = request.host_url + PATH_ROOT + '/' + PATH_ICON + '?id=' + vtuner_station.uid
if enable_clickvote and generic.get_stationid_prefix(station.id) == 'RB':
radiobrowser.click_vote(generic.get_stationid_without_prefix(station.id))
page = vtuner.Page()
page.add(vtuner_station)
page.set_count(1)