Skip to content

Commit

Permalink
HVV: default max locations to 20 (fixes #86)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-albers committed Jun 6, 2023
1 parent dc52844 commit 75c010c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Sources/TripKit/Provider/Implementations/HvvProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ public class HvvProvider: AbstractNetworkProvider {
"language": queryLanguage ?? defaultLanguage,
"theName": ["name": constraint]
]
if maxLocations > 0 {
dict["maxList"] = maxLocations
}
dict["maxList"] = maxLocations > 0 ? maxLocations : 20
let request = encodeJson(dict: dict, requestUrlEncoding: .utf8)
let urlBuilder = UrlBuilder(path: HvvProvider.API_BASE + "checkName", encoding: .utf8)

Expand Down Expand Up @@ -142,9 +140,7 @@ public class HvvProvider: AbstractNetworkProvider {
"language": queryLanguage ?? defaultLanguage,
"theName": name
]
if maxLocations > 0 {
dict["maxList"] = maxLocations
}
dict["maxList"] = maxLocations > 0 ? maxLocations : 20
if maxDistance > 0 {
dict["maxDistance"] = maxDistance
}
Expand Down Expand Up @@ -178,9 +174,7 @@ public class HvvProvider: AbstractNetworkProvider {
"allStationsInChangingNode": equivs,
"maxTimeOffset": 720 // maximum 12 hours in advance
]
if maxDepartures > 0 {
dict["maxList"] = maxDepartures
}
dict["maxList"] = maxDepartures > 0 ? maxDepartures : 20
if let time = time {
dict["time"] = jsonDate(date: time)
}
Expand Down

0 comments on commit 75c010c

Please sign in to comment.