method to add and print radio stations

workspace
Brendan Howell 4 years ago
parent fb4d768375
commit 14ceebfc03

@ -160,6 +160,7 @@ class Audio(Bureau):
# if line startswith #EXTINF: title = first comma to EOL # if line startswith #EXTINF: title = first comma to EOL
# if line startswith Title then title = first '=' to EOL # if line startswith Title then title = first '=' to EOL
title = "" title = ""
self.log.debug("PLAYLIST TEXT: \n" + resp.text)
for line in resp.text: for line in resp.text:
if line.startswith("#EXTINF:"): if line.startswith("#EXTINF:"):
# this is m3u playlist - title is from first comma to EOL # this is m3u playlist - title is from first comma to EOL
@ -170,7 +171,7 @@ class Audio(Bureau):
# TODO: create barcode # TODO: create barcode
# small print title, url, barcode # small print title, url, barcode
txt = "RADIO STATION:\r\n" + title + "\r\n" + url txt = "RADIO STATION:\r\n\r\n" + title + "\r\n\r\n" + url
self.print_small(txt, cut=False) self.print_small(txt, cut=False)
bc_img = kode256.image("AUp." + shortcode) bc_img = kode256.image("AUp." + shortcode)

Loading…
Cancel
Save