shithub: zuke

Download patch

ref: 16cfcf740580aa7bf875b1628a9ac92ca19e56cb
parent: 5be6d6790c5de9fa2272eec3e1fb346e7c6130be
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Aug 27 06:52:03 EDT 2020

don't display duration at all if it's unknown (as it is with online streams)

--- a/zuke.c
+++ b/zuke.c
@@ -107,10 +107,15 @@
 	case Palbum: return m->album;
 	case Partist: return m->artist[0];
 	case Pdate: return m->date;
-	case Pduration: snprint(tmp, sizeof(tmp), "%8P", m->duration/1000); return tmp;
 	case Ptitle: return m->title;
 	case Ptrack: snprint(tmp, sizeof(tmp), "%4s", m->track); return m->track ? tmp : nil;
 	case Ppath: return m->path;
+	case Pduration:
+		if(m->duration < 1)
+			tmp[0] = 0;
+		else
+			snprint(tmp, sizeof(tmp), "%8P", m->duration/1000);
+		return tmp;
 	default: sysfatal("invalid column '%c'", c);
 	}