Explorar o código

PlaylistModel: Add creation method

Soomin Lee %!s(int64=7) %!d(string=hai) anos
pai
achega
3a49c711ea
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      SharedSources/MediaLibraryModel/PlaylistModel.swift

+ 6 - 0
SharedSources/MediaLibraryModel/PlaylistModel.swift

@@ -34,6 +34,12 @@ class PlaylistModel: MLBaseModel {
         }
         files.append(item)
     }
+
+    // Creates a VLCMLPlaylist appending it and updates linked view
+    func create(name: String) {
+        append(medialibrary.createPlaylist(with: name))
+        updateView?()
+    }
 }
 
 extension PlaylistModel: MediaLibraryObserver {