Przeglądaj źródła

VideoModel: Check for duplicate before append

Soomin Lee 7 lat temu
rodzic
commit
c83abf7c31
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      SharedSources/MediaLibraryModel/VideoModel.swift

+ 5 - 0
SharedSources/MediaLibraryModel/VideoModel.swift

@@ -27,6 +27,11 @@ class VideoModel: MLBaseModel {
     }
 
     func append(_ item: VLCMLMedia) {
+        for file in files {
+            if file.identifier() == item.identifier() {
+                return
+            }
+        }
         files.append(item)
     }