Commit 18def637 authored by Soomin Lee's avatar Soomin Lee

VideoModel: Add sort

parent ca58d7ac
......@@ -34,6 +34,16 @@ class VideoModel: MLBaseModel {
}
}
// MARK: - Sort
extension VideoModel {
func sort(by criteria: VLCMLSortingCriteria) {
files = medialibrary.media(ofType: .video, sortingCriteria: criteria, desc: false)
updateView?()
}
}
extension VideoModel: MediaLibraryObserver {
func medialibrary(_ medialibrary: VLCMediaLibraryManager, didAddVideo video: [VLCMLMedia]) {
video.forEach({ append($0) })
......
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