Browse Source

VideoModel: Check for duplicate before append

Soomin Lee 7 years ago
parent
commit
c83abf7c31
1 changed files with 5 additions and 0 deletions
  1. 5 0
      SharedSources/MediaLibraryModel/VideoModel.swift

+ 5 - 0
SharedSources/MediaLibraryModel/VideoModel.swift

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