Forráskód Böngészése

PlaylistModel: Check for duplicate

Soomin Lee 7 éve
szülő
commit
849463092a
1 módosított fájl, 5 hozzáadás és 0 törlés
  1. 5 0
      SharedSources/MediaLibraryModel/PlaylistModel.swift

+ 5 - 0
SharedSources/MediaLibraryModel/PlaylistModel.swift

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