Added Option to automatically remove saved items.
This commit is contained in:
committed by
Kim Wittenburg
parent
8d4fba8d8a
commit
e0261f7353
@@ -350,6 +350,28 @@ internal class MainViewController: NSViewController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue()) {
|
||||
if Preferences.sharedPreferences.removeSavedItems {
|
||||
for item in items {
|
||||
if let album = item as? Album {
|
||||
for track in album.tracks {
|
||||
track.associatedTracks.removeAll()
|
||||
}
|
||||
if !Preferences.sharedPreferences.keepSavedAlbums {
|
||||
self.albumCollection.removeAlbum(album)
|
||||
}
|
||||
} else if let track = item as? Track {
|
||||
track.associatedTracks.removeAll()
|
||||
} else if let track = item as? iTunesTrack {
|
||||
if let parentTrack = self.parentForTrack(track) {
|
||||
parentTrack.associatedTracks.removeElement(track)
|
||||
}
|
||||
}
|
||||
}
|
||||
self.outlineView.reloadData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func numberOfTracksInItems(items: [AnyObject]) -> Int {
|
||||
|
||||
Reference in New Issue
Block a user