瀏覽代碼

library: don't display remaining time if it's less than a minute

Felix Paul Kühne 11 年之前
父節點
當前提交
5689e011bf
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Sources/VLCPlaylistCollectionViewCell.m
  2. 1 1
      Sources/VLCPlaylistTableViewCell.m

+ 1 - 1
Sources/VLCPlaylistCollectionViewCell.m

@@ -231,7 +231,7 @@
 
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
         CGFloat duration = mediaItem.duration.floatValue;
-        if (position > .1f && position < .95f) {
+        if (position > .1f && position < .95f && (duration * position - duration) > 0) {
             [(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(duration * position - duration)] minuteStringValue]]];
             self.mediaIsUnreadView.hidden = NO;
         } else if (mediaItem.unread.intValue) {

+ 1 - 1
Sources/VLCPlaylistTableViewCell.m

@@ -223,7 +223,7 @@
 
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
         CGFloat duration = mediaItem.duration.floatValue;
-        if (position > .1f && position < .95f) {
+        if (position > .1f && position < .95f && (duration * position - duration) > 0) {
             [(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(duration * position - duration)] minuteStringValue]]];
             self.mediaIsUnreadView.hidden = NO;
         } else if (mediaItem.unread.intValue) {