mirror of
https://github.com/mas-cli/mas
synced 2024-11-25 04:50:24 +00:00
Rename some uses of *Url
as *URL
.
Partial #585 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
0b11f3737c
commit
59a642590a
1 changed files with 4 additions and 4 deletions
|
@ -77,12 +77,12 @@ class MasStoreSearch: StoreSearch {
|
||||||
return .value(nil)
|
return .value(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let pageUrl = URL(string: result.trackViewUrl) else {
|
guard let pageURL = URL(string: result.trackViewUrl) else {
|
||||||
return .value(result)
|
return .value(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
return firstly {
|
return firstly {
|
||||||
self.scrapeAppStoreVersion(pageUrl)
|
self.scrapeAppStoreVersion(pageURL)
|
||||||
}
|
}
|
||||||
.map { pageVersion in
|
.map { pageVersion in
|
||||||
guard let pageVersion,
|
guard let pageVersion,
|
||||||
|
@ -120,9 +120,9 @@ class MasStoreSearch: StoreSearch {
|
||||||
/// Scrape the app version from the App Store webpage at the given URL.
|
/// Scrape the app version from the App Store webpage at the given URL.
|
||||||
///
|
///
|
||||||
/// App Store webpages frequently report a version that is newer than what is reported by the iTunes Search API.
|
/// App Store webpages frequently report a version that is newer than what is reported by the iTunes Search API.
|
||||||
private func scrapeAppStoreVersion(_ pageUrl: URL) -> Promise<Version?> {
|
private func scrapeAppStoreVersion(_ pageURL: URL) -> Promise<Version?> {
|
||||||
firstly {
|
firstly {
|
||||||
networkManager.loadData(from: pageUrl)
|
networkManager.loadData(from: pageURL)
|
||||||
}
|
}
|
||||||
.map { data in
|
.map { data in
|
||||||
guard let html = String(data: data, encoding: .utf8),
|
guard let html = String(data: data, encoding: .utf8),
|
||||||
|
|
Loading…
Reference in a new issue