~ft/zuke

eac2af266c6a009cee2d49dfb3e2165736ea6406 — Sigrid Haflínudóttir a month ago 283868a
status width: fix for online streams with no known duration
1 files changed, 10 insertions(+), 5 deletions(-)

M zuke.c
M zuke.c => zuke.c +10 -5
@@ 265,13 265,13 @@ redraw(int full)

	vlong msec = 0;
	if(pcurplaying >= 0){
		snprint(tmp, sizeof(tmp), "%s%P/%P 100%%",
			shuffle != nil ? "∫ " : "",
			getmeta(pcurplaying)->duration/1000,
			getmeta(pcurplaying)->duration/1000);
		w = stringwidth(f, tmp);
		msec = byteswritten*1000/Bps;
		if(getmeta(pcurplaying)->duration != 0){
			snprint(tmp, sizeof(tmp), "%s%P/%P 100%%",
				shuffle != nil ? "∫ " : "",
				getmeta(pcurplaying)->duration/1000,
				getmeta(pcurplaying)->duration/1000);
			w = stringwidth(f, tmp);
			msec = MIN(msec, getmeta(pcurplaying)->duration);
			snprint(tmp, sizeof(tmp), "%s%P/%P %d%%",
				shuffle != nil ? "∫ " : "",


@@ 282,6 282,11 @@ redraw(int full)
		}else{
			snprint(tmp, sizeof(tmp), "%s%P %d%%",
				shuffle != nil ? "∫ " : "",
				getmeta(pcurplaying)->duration/1000,
				100);
			w = stringwidth(f, tmp);
			snprint(tmp, sizeof(tmp), "%s%P %d%%",
				shuffle != nil ? "∫ " : "",
				(int)msec/1000,
				volume);
		}