foo_discord_rich
foo_discord_rich copied to clipboard
only shows HDCD info when manually selecting track
I am using the following for the Top section:
[%album artist% - ][%date% - ][%album%][ '['$meta(DISCID)']'][ '['Disc %discnumber%/%totaldiscs%']'] | [%codec%]$if($info(hdcd),' HDCD') [%bitrate%]kbps $if($stricmp($info(encoding),lossless),[%__bitspersample%]bit,) $div(%samplerate%,1000)$replace($insert($right($div(%samplerate%,100),1),.,0),.0,)kHz
This piece of code $if($info(hdcd),' HDCD')
only shows "HDCD" when I manually select a track to play, when the track ends and the next one starts playing automatically, "HDCD" is no longer shown until I manually select a track to play.
The same applies to the shown bitdepth $if($stricmp($info(encoding),lossless),[%__bitspersample%]bit,),
it shows "24-bit" when track is manually selected, but the tracks that play automatically will only show "16-bit".
incorrect HDCD info
correct HDCD info when I manually change to that same track
Might be coz it sends data at the beginning and doesn't update it afterwards, the same thing I have with streamed audio when the bitrate is reported only while decoding so doesn't get updated. Auto-update period would likely fix that I think but there isn't any :(
Auto-update period would likely fix that
I might add auto-update (radio seems to be a valid use-case), but it will be really far from real-time updates, since Discord only allows to update status once per 15 seconds.
once/15sec is perfectly fine in my opinion, it could also benefit from some routine when it detects if there are variables, such as bitrate or HDCD, radio station updates song title and whatnot and then have that 15 second delay if that's possible
Note to self: track name change (e.g. radio) is already handle by on_playback_dynamic_info_track