浏览代码

MediaLibraryModel: Remove unnecessary code

Soomin Lee 7 年之前
父节点
当前提交
e38bf70ffd

+ 0 - 5
SharedSources/MediaLibraryModel/AlbumModel.swift

@@ -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)
     }
 }

+ 0 - 3
SharedSources/MediaLibraryModel/ArtistModel.swift

@@ -26,9 +26,6 @@ class ArtistModel: MLBaseModel {
         files = medialibrary.getArtists()
     }
 
-    func isIncluded(_ item: VLCMLArtist) {
-    }
-
     func append(_ item: VLCMLArtist) {
         files.append(item)
     }

+ 1 - 6
SharedSources/MediaLibraryModel/AudioModel.swift

@@ -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)

+ 0 - 5
SharedSources/MediaLibraryModel/GenreModel.swift

@@ -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)
     }
 }

+ 0 - 6
SharedSources/MediaLibraryModel/MediaLibraryBaseModel.swift

@@ -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()
     }

+ 0 - 3
SharedSources/MediaLibraryModel/ShowEpisodeModel.swift

@@ -25,9 +25,6 @@ class ShowEpisodeModel: MLBaseModel {
         medialibrary.addObserver(self)
     }
 
-    func isIncluded(_ item: VLCMLMedia) {
-    }
-
     func append(_ item: VLCMLMedia) {
         files.append(item)
     }

+ 0 - 4
SharedSources/MediaLibraryModel/VideoModel.swift

@@ -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?()