Commit e38bf70f authored by Soomin Lee's avatar Soomin Lee

MediaLibraryModel: Remove unnecessary code

parent 0b2d0b87
......@@ -23,15 +23,10 @@ class AlbumModel: MLBaseModel {
required init(medialibrary: VLCMediaLibraryManager) {
self.medialibrary = medialibrary
medialibrary.addObserver(self)
// created too late so missed the callback asking if he has anything
files = medialibrary.getAlbums()
}
func isIncluded(_ item: VLCMLAlbum) {
}
func append(_ item: VLCMLAlbum) {
// need to check more for duplicate and stuff
files.append(item)
}
}
......
......@@ -26,9 +26,6 @@ class ArtistModel: MLBaseModel {
files = medialibrary.getArtists()
}
func isIncluded(_ item: VLCMLArtist) {
}
func append(_ item: VLCMLArtist) {
files.append(item)
}
......
......@@ -23,22 +23,17 @@ class AudioModel: MLBaseModel {
required init(medialibrary: VLCMediaLibraryManager) {
self.medialibrary = medialibrary
medialibrary.addObserver(self)
// created too late so missed the callback asking if he has anything
files = medialibrary.media(ofType: .audio)
}
func isIncluded(_ item: VLCMLMedia) {
}
func append(_ item: VLCMLMedia) {
// need to check more for duplicate and stuff
files.append(item)
}
}
// MARK: - Sort
extension AudioModel {
func sort(by criteria: VLCMLSortingCriteria) {
// FIXME: Currently if sorted by name, the files are sorted by filename but displaying title
files = medialibrary.media(ofType: .audio, sortingCriteria: criteria, desc: false)
......
......@@ -23,15 +23,10 @@ class GenreModel: MLBaseModel {
required init(medialibrary: VLCMediaLibraryManager) {
self.medialibrary = medialibrary
medialibrary.addObserver(self)
// created too late so missed the callback asking if he has anything
files = medialibrary.genre()
}
func isIncluded(_ item: VLCMLGenre) {
}
func append(_ item: VLCMLGenre) {
// need to check more for duplicate and stuff
files.append(item)
}
}
......
......@@ -20,7 +20,6 @@ protocol MediaLibraryBaseModel {
var indicatorName: String { get }
func append(_ item: VLCMLObject)
func isIncluded(_ item: VLCMLObject)
func sort(by criteria: VLCMLSortingCriteria)
}
......@@ -38,7 +37,6 @@ protocol MLBaseModel: MediaLibraryBaseModel {
var indicatorName: String { get }
func append(_ item: MLType)
func isIncluded(_ item: MLType)
func sort(by criteria: VLCMLSortingCriteria)
}
......@@ -51,10 +49,6 @@ extension MLBaseModel {
fatalError()
}
func isIncluded(_ item: VLCMLObject) {
fatalError()
}
func sort(by criteria: VLCMLSortingCriteria) {
fatalError()
}
......
......@@ -25,9 +25,6 @@ class ShowEpisodeModel: MLBaseModel {
medialibrary.addObserver(self)
}
func isIncluded(_ item: VLCMLMedia) {
}
func append(_ item: VLCMLMedia) {
files.append(item)
}
......
......@@ -26,9 +26,6 @@ class VideoModel: MLBaseModel {
files = medialibrary.media(ofType: .video)
}
func isIncluded(_ item: VLCMLMedia) {
}
func append(_ item: VLCMLMedia) {
files.append(item)
}
......@@ -37,7 +34,6 @@ class VideoModel: MLBaseModel {
// MARK: - Sort
extension VideoModel {
func sort(by criteria: VLCMLSortingCriteria) {
files = medialibrary.media(ofType: .video, sortingCriteria: criteria, desc: false)
updateView?()
......
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