|
@@ -171,20 +171,20 @@ func getDashboardDataEntry(intent: Applications, isPreview: Bool, displaySize: C
|
|
|
if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
|
|
|
var size: CGFloat = 128
|
|
|
if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
|
|
|
+
|
|
|
+ let path = (urlComponents.path as NSString)
|
|
|
+ let pathComponents = path.components(separatedBy: "/")
|
|
|
let queryItems = urlComponents.queryItems
|
|
|
+
|
|
|
if let item = CCUtility.value(forKey: "fileId", fromQueryItems: queryItems) {
|
|
|
iconFileName = item
|
|
|
- } else {
|
|
|
- let path = (urlComponents.path as NSString)
|
|
|
- let components = path.components(separatedBy: "/")
|
|
|
- if components[1] == "avatar", components.count == 4 {
|
|
|
- iconFileName = components[2]
|
|
|
- if let int = Int(components[3]) {
|
|
|
- size = CGFloat(int)
|
|
|
- }
|
|
|
- } else {
|
|
|
- iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
|
|
|
+ } else if pathComponents[1] == "avatar" {
|
|
|
+ iconFileName = pathComponents[2]
|
|
|
+ if let int = Int(pathComponents[3]) {
|
|
|
+ size = CGFloat(int)
|
|
|
}
|
|
|
+ } else {
|
|
|
+ iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
|
|
|
}
|
|
|
}
|
|
|
let semaphore = DispatchSemaphore(value: 0)
|