# Downloader Migration History ## Downloader ### Added - A method ` func makeItems(entities: ) -> [DownloadStream] ` which is used to transform `DownloadItemEntity` into `[DownloadStream]` - A method `public func cancelAllTasks(completionHandler: (() -> Void)?)` whic is used to cancel all download tasks ### Modified - `loadUserList()` will return user id list from download items datasource ### Removed - `self` as possible - A property `list:[KKSStram]`, `items:[DownloadStream]` instead ## DownloadStream ### Added - A struct `DownloadSource` which is used to keep the info of DownloadItem and ManifestItem, we can easily convert to memory objects from core data - A constructor `init?(item: DownloadItemEntity, context: DownloadContext)` which is used to transform DownloadItemEntity, DownloadInfoEntity into DownloadStream ### Removed - A property `thumbnail` - A property `thumbnailSeeking` - A property `manifestAtIndex` ## DRMContextModelKey ENUM ### Removed - `platform` key - `model` key - `manufacturer` key ## DRMContextModelValue ENUM ### Removed - `platform` value - `manufacturer` value ## KKSContentKeyContextModel struct ### Removed - `itemId` property - `licenseId` property - `itemType` property ### Added - `token` property ## SyncItem struct ### Added - A constructor `init(videoId:, license: )` ## KKSLicense & KKSLicenseTime ### Added - A constructor `init` in KKSLicense - A constructor `init` in KKSLicenseTime ## KKSDataManager ### Removed - A useless protocol `DataManageable` - A method `func buildStream(downloadItem: DownloadItemEntity) -> DownloadStream? ` - A method `func buildManifest(item: DownloadItemEntity) -> KKSManifestItem?` - A method `func buildLicense(item: DownloadItemEntity) -> KKSLicense` ## Season ### Added - static method `static func make(_ downloadInfo: ) -> Season` ## ManifestBuilder ### Added - A extension method `func deletingPrefix(_ prefix: String) -> String` ## MediaPlayList ### Added - A open property `uri` which will be presented the session-key value of manifest ## Asset - Added a property `fairPlay` ## Download Changes - `KKStream` is deprecated, `DownloadStream` instead - `userId` is required - `StateNotification` will be posted if download state did change - `completeDownloadApiForRenew` & `completDownloadApiForDownload` has been mixed into `completDownloadApi` - `token` will be added into `userInfo` if content key response is successful - `DownloadItemEntity` becomes `Manual` from `Class Definition` - A `fairPlay` property of `DownloadStream` is moved into `Asset` - `Asset+AssetResourceLoaderDelegate.swift` was removed - `ManifestParsable` protocol was removed, this extension method is moved into `Asset`