Commit 20714bce authored by Soomin Lee's avatar Soomin Lee

VLCEditController: Update playlist handling

parent 8288f92c
......@@ -99,14 +99,27 @@ extension VLCEditController: VLCEditControllerDataSource {
extension VLCEditController: VLCEditToolbarDelegate {
func createPlaylist() {
if let model = category as? PlaylistModel {
model.create(name: "new playlist")
let alertInfo = TextFieldAlertInfo(alertTitle: NSLocalizedString("VIDEO_PLAYLISTS", comment: ""),
placeHolder: "NEW_PLAYLIST")
presentTextFieldAlert(with: alertInfo, completionHandler: {
text -> Void in
model.create(name: text)
})
} else if let model = category as? VideoModel {
let playlist = model.medialibrary.createPlaylist(with: "new playlist videomo")
for indexPath in selectedCellIndexPaths {
if let media = dataSet[indexPath.row] as? VLCMLMedia {
playlist.appendMedia(withIdentifier: media.identifier())
let alertInfo = TextFieldAlertInfo(alertTitle: NSLocalizedString("VIDEO_PLAYLISTS", comment: ""),
placeHolder: "NEW_PLAYLIST")
presentTextFieldAlert(with: alertInfo, completionHandler: {
[selectedCellIndexPaths, category] text -> Void in
let playlist = model.medialibrary.createPlaylist(with: text)
for indexPath in selectedCellIndexPaths {
if let media = category.anyfiles[indexPath.row] as? VLCMLMedia {
playlist.appendMedia(withIdentifier: media.identifier())
}
}
}
})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment