From f01cfdb4fd3813ee9ac305f575bb013c5c20e3b6 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 22 Sep 2018 03:11:13 -0700 Subject: [PATCH] Fix playlist entry to return 0 length instead of NaN when metadata hasn't loaded yet. --- Playlist/PlaylistEntry.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 4cd329a6f..e736f1844 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -287,7 +287,7 @@ @dynamic length; - (NSNumber *)length { - return [NSNumber numberWithDouble:((double)self.totalFrames / self.sampleRate)]; + return [NSNumber numberWithDouble:(self.metadataLoaded)?((double)self.totalFrames / self.sampleRate):0.0]; } @dynamic path;