Commit 01b28bc4 authored by Soomin Lee's avatar Soomin Lee

CollectionModel: Assign sortModel from mediaCollection when set

parent c8d895f7
......@@ -35,6 +35,17 @@ class CollectionModel: MLBaseModel {
required init(mediaService: MediaLibraryService, mediaCollection: MediaCollectionModel) {
self.medialibrary = mediaService
self.mediaCollection = mediaCollection
self.sortModel = mediaCollection.sortModel() ?? self.sortModel
var sortingCriteria: VLCMLSortingCriteria = .default
if mediaCollection is VLCMLArtist
|| mediaCollection is VLCMLGenre
|| mediaCollection is VLCMLAlbum {
sortingCriteria = .album
}
self.sortModel.currentSort = sortingCriteria
files = mediaCollection.files() ?? []
medialibrary.addObserver(self)
}
......
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