Closed Coolguy3289 closed 3 months ago
Now that is strange) I've already made a PR.
Also note I've made amendments to my initial code to send only title
when artist
is empty. So no need to double it.
def write_txt(m) =
if m["artist"] != "" then
ignore(file.write(data="#{m[\"artist\"]} - #{m[\"title\"]}", append=false, "/var/azuracast/www/web/static/nowplaying.txt"))
else
ignore(file.write(data="#{m[\"title\"]}", append=false, "/var/azuracast/www/web/static/nowplaying.txt"))
end
end
radio.on_metadata(write_txt)
Updated my code snippet to match your artist check! As mentioned on Discord, I wasn't paying attention to whether a PR was made already in reference to this discussion. That being said I attempted to write my PR with the same consistency of styling currently used by the existing methods on this page, including adding some brief advantages/disadvantages of using this method.
Not necessary; see #103.
Proposed changes: