浏览代码

Library: fixed corner-case where a thumbnail was created but failed to be displayed

Felix Paul Kühne 12 年之前
父节点
当前提交
3e11eaac93
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 5 0
      AspenProject/VLCPlaylistGridView.m
  2. 5 0
      AspenProject/VLCPlaylistTableViewCell.m

+ 5 - 0
AspenProject/VLCPlaylistGridView.m

@@ -131,6 +131,11 @@
                 [_thumbnailCacheIndex removeObject:objID];
                 [_thumbnailCacheIndex insertObject:objID atIndex:0];
                 displayedImage = [_thumbnailCache objectForKey:objID];
+                if (!displayedImage) {
+                    displayedImage = mediaObject.computedThumbnail;
+                    if (displayedImage)
+                        [_thumbnailCache setObject:displayedImage forKey:objID];
+                }
             } else {
                 if (_thumbnailCacheIndex.count >= MAX_CACHE_SIZE) {
                     [_thumbnailCache removeObjectForKey:[_thumbnailCacheIndex lastObject]];

+ 5 - 0
AspenProject/VLCPlaylistTableViewCell.m

@@ -114,6 +114,11 @@
                 [_thumbnailCacheIndex removeObject:objID];
                 [_thumbnailCacheIndex insertObject:objID atIndex:0];
                 displayedImage = [_thumbnailCache objectForKey:objID];
+                if (!displayedImage) {
+                    displayedImage = mediaObject.computedThumbnail;
+                    if (displayedImage)
+                        [_thumbnailCache setObject:displayedImage forKey:objID];
+                }
             } else {
                 if (_thumbnailCacheIndex.count >= MAX_CACHE_SIZE) {
                     [_thumbnailCache removeObjectForKey:[_thumbnailCacheIndex lastObject]];