Skip to content
Discussion options

You must be logged in to vote
	def loader(self) -> None:
			# ...
			identity = f"{station.icon}\n{station.stream_url}"
			filename = f"{filename_safe(station.title)}-{hashlib.sha256(identity.encode()).hexdigest()[:10]}"

Presuming icon will be an empty string, I suppose you could execute python and feed it the following:

import hashlib
def filename_safe(text: str, sub: str = "") -> str:
	for cha in '/\\<>:"|?*':
		text = text.replace(cha, sub)
	return text.rstrip(" .")

f"{filename_safe("7 Rays Radio"}-{hashlib.sha256("\nhttps://radiowhatever.com/stream".encode()).hexdigest()[:10]}"

Which spits out '7 Rays Radio-5e061a95ef'

Honestly just open a feature request for nice setting of radio icons in the UI if there isn't o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jansengj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants